From 21126174e5c1b8395379823d91dcc27ec6971948 Mon Sep 17 00:00:00 2001 From: David Given Date: Thu, 25 Jun 2015 23:41:48 +0200 Subject: [PATCH] Allow files to be added to the root. --- Standalone/filesystem-src/populatefs.awk | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Standalone/filesystem-src/populatefs.awk b/Standalone/filesystem-src/populatefs.awk index 1a5f9089..97d8fd71 100644 --- a/Standalone/filesystem-src/populatefs.awk +++ b/Standalone/filesystem-src/populatefs.awk @@ -3,12 +3,14 @@ BEGIN { printf "chmod 01777 /tmp\n"; } -function dirname(f) +function dirname(f, d) { + d = ""; if (f ~ /\//) - return gensub(/\/[^/]*$/, "", "g", f); - else - return ""; + d = gensub(/\/[^/]*$/, "", "g", f); + if (d == "") + return "/"; + return d; } function basename(f) @@ -21,7 +23,7 @@ function mkdirp(dir, base) if (!made[dir]) { base = dirname(dir); - if (base != "") + if (base != "/") mkdirp(base); printf "mkdir " dir "\n"; printf "chmod 0755 " dir "\n"; -- 2.34.1