aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2018-12-26 12:07:14 -0600
committerRob Landley <rob@landley.net>2018-12-26 12:07:14 -0600
commit831266c06862c1be6195382a02b86cb52ef304dc (patch)
tree43f84f96feb080c86580ff1057c082fcc985d777 /lib
parent5a670c5883a996e7b99f9ca900fd0e2ec53eb583 (diff)
downloadtoybox-831266c06862c1be6195382a02b86cb52ef304dc.tar.gz
Teach the argument plumbing how to do -@ for mkfs.vfat
Diffstat (limited to 'lib')
-rw-r--r--lib/args.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/args.c b/lib/args.c
index b24dd417..54106c25 100644
--- a/lib/args.c
+++ b/lib/args.c
@@ -84,6 +84,9 @@
// + Synonyms (switch on all) [+abc] means -ab=-abc, -c=-abc
// ! More than one in group is error [!abc] means -ab calls error_exit()
// primarily useful if you can switch things back off again.
+//
+// You may use octal escapes with the high bit (127) set to use a control
+// character as an option flag. For example, \300 would be the option -@
// Notes from getopt man page
// - and -- cannot be arguments.
@@ -128,7 +131,7 @@ struct getoptflagstate
unsigned excludes, requires;
};
-// Use getoptflagstate to parse parse one command line option from argv
+// Use getoptflagstate to parse one command line option from argv
static int gotflag(struct getoptflagstate *gof, struct opts *opt)
{
int type;
@@ -317,7 +320,7 @@ void parse_optflaglist(struct getoptflagstate *gof)
continue;
// Claim this option, loop to see what's after it.
- } else new->c = *options;
+ } else new->c = 127&*options;
options++;
}