aboutsummaryrefslogtreecommitdiff
path: root/mkfs
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-17 10:53:22 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-17 11:05:42 +0200
commit1f980897f6947dd17eaa0190b2c1a23fb700636b (patch)
treecc46ed7f514323b9bd7bfb2f633dc4d17b99c091 /mkfs
parente3ef871d6a80d72db02c9ab1ef492e8f58c2ddeb (diff)
fstree: add support for spaces in filenames
This commit adds a mechanism to fstree_from_file to support filenames with spaces in them by quoting the entire string. Quote marks can still be used inside file names by escaping them with a backslash. Back slashes (if that is your thing) can also be escaped. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'mkfs')
-rw-r--r--mkfs/options.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/mkfs/options.c b/mkfs/options.c
index 25f7453..2dab6b8 100644
--- a/mkfs/options.c
+++ b/mkfs/options.c
@@ -83,7 +83,8 @@ static const char *help_string =
"pipe <path> <mode> <uid> <gid>\n"
"sock <path> <mode> <uid> <gid>\n"
"\n"
-"<path> Absolute path of the entry in the image.\n"
+"<path> Absolute path of the entry in the image. Can be put in quotes\n"
+" if some components contain spaces.\n"
"<location> If given, location of the input file. Either absolute or relative\n"
" to the description file. If omitted, the image path is used,\n"
" relative to the description file.\n"
@@ -107,7 +108,10 @@ static const char *help_string =
" \n"
" # Read bin/bash, relative to listing or pack dir.\n"
" # Implicitly create /bin.\n"
-" file /bin/bash 0755 0 0"
+" file /bin/bash 0755 0 0\n"
+" \n"
+" # file name with a space in it.\n"
+" file \"/opt/my app/\\\"special\\\"/data\" 0600 0 0\n"
"\n\n";
void process_command_line(options_t *opt, int argc, char **argv)