From 1f980897f6947dd17eaa0190b2c1a23fb700636b Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 17 Jul 2019 10:53:22 +0200 Subject: 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 --- mkfs/options.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'mkfs') 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 \n" "sock \n" "\n" -" Absolute path of the entry in the image.\n" +" Absolute path of the entry in the image. Can be put in quotes\n" +" if some components contain spaces.\n" " 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) -- cgit v1.2.3