diff options
author | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-09-20 18:10:34 +0000 |
---|---|---|
committer | giraffedata <giraffedata@9d0c8265-081b-0410-96cb-a4ca84ce46f8> | 2023-09-20 18:10:34 +0000 |
commit | 553be9f71998e872838769b1a9be6972ab8ccb8e (patch) | |
tree | ae3bab030ec894e3ab33a34d66d0cd1783667e3b /lib/util/shhopt.c | |
parent | c57fb692012684f1a5b1e84c2e31dc289ef70219 (diff) | |
download | netpbm-mirror-553be9f71998e872838769b1a9be6972ab8ccb8e.tar.gz netpbm-mirror-553be9f71998e872838769b1a9be6972ab8ccb8e.tar.xz netpbm-mirror-553be9f71998e872838769b1a9be6972ab8ccb8e.zip |
whitespace
git-svn-id: http://svn.code.sf.net/p/netpbm/code/trunk@4672 9d0c8265-081b-0410-96cb-a4ca84ce46f8
Diffstat (limited to 'lib/util/shhopt.c')
-rw-r--r-- | lib/util/shhopt.c | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/lib/util/shhopt.c b/lib/util/shhopt.c index 00f9c341..32d0916d 100644 --- a/lib/util/shhopt.c +++ b/lib/util/shhopt.c @@ -252,10 +252,10 @@ static int optNeedsArgument(const optEntry opt) { return opt.type == OPT_STRING - || opt.type == OPT_INT - || opt.type == OPT_UINT - || opt.type == OPT_LONG - || opt.type == OPT_ULONG + || opt.type == OPT_INT + || opt.type == OPT_UINT + || opt.type == OPT_LONG + || opt.type == OPT_ULONG || opt.type == OPT_FLOAT || opt.type == OPT_NAMELIST || opt.type == OPT_STRINGLIST @@ -717,28 +717,28 @@ parse_short_option_token(char *argv[], const int argc, const int ai, while (*o && !processed_arg) { bool found; int mi; /* index into option table */ - /* find matching option */ - optMatch(opt_table, o, SL_SHORT, &found, &mi); - if (!found) - optFatal("unrecognized option `-%c'", *o); - - /* does this option take an argument? */ - if (optNeedsArgument(opt_table[mi])) { - /* option needs an argument. find it. */ - arg = o + 1; - if (!*arg) { + /* find matching option */ + optMatch(opt_table, o, SL_SHORT, &found, &mi); + if (!found) + optFatal("unrecognized option `-%c'", *o); + + /* does this option take an argument? */ + if (optNeedsArgument(opt_table[mi])) { + /* option needs an argument. find it. */ + arg = o + 1; + if (!*arg) { if (ai + 1 >= argc) - optFatal("option `%s' requires an argument", - optString(opt_table[mi], 0)); - arg = argv[ai+1]; + optFatal("option `%s' requires an argument", + optString(opt_table[mi], 0)); + arg = argv[ai+1]; (*tokens_consumed_p)++; - } - processed_arg = 1; - } else + } + processed_arg = 1; + } else arg = NULL; - /* perform the action of this option. */ - optExecute(opt_table[mi], arg, 0); - ++o; + /* perform the action of this option. */ + optExecute(opt_table[mi], arg, 0); + ++o; } } |