shared/optparser.c: improve handling of short switches (bb#1374)

git-svn: trunk@4665
0.95
Tomasz Kojm 17 years ago
parent 1d8a56d491
commit 32390e3161
  1. 4
      ChangeLog
  2. 6
      shared/optparser.c

@ -1,3 +1,7 @@
Fri Jan 30 09:13:15 CET 2009 (tk)
---------------------------------
* shared/optparser.c: improve handling of short switches (bb#1374)
Thu Jan 29 20:27:45 CET 2009 (tk)
---------------------------------
* shared/optparser.c, clamconf/clamconf.c: add --generate-config

@ -653,9 +653,11 @@ struct optstruct *optparse(const char *cfgfile, int argc, char **argv, int verbo
return NULL;
}
shortopts[sc++] = optentry->shortopt;
shortopts[sc++] = ':';
if(!(optentry->flags & FLAG_REQUIRED) && (optentry->argtype == TYPE_BOOL || optentry->strarg))
if(optentry->argtype != TYPE_BOOL) {
shortopts[sc++] = ':';
if(!(optentry->flags & FLAG_REQUIRED) && optentry->strarg)
shortopts[sc++] = ':';
}
}
}
}

Loading…
Cancel
Save