X-Git-Url: https://git.distorted.org.uk/~mdw/cfd/blobdiff_plain/379c3233ebd6c9ea6b29b9c0058db99ce5dc430e..aaa993397614d23a868fcbb5b8b50704538644a3:/mdwopt.c diff --git a/mdwopt.c b/mdwopt.c index 6814e99..1717d2d 100644 --- a/mdwopt.c +++ b/mdwopt.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: mdwopt.c,v 1.5 1999/05/19 20:23:59 mdw Exp $ + * $Id: mdwopt.c,v 1.7 1999/06/18 21:59:46 mdw Exp $ * * Options parsing, similar to GNU @getopt_long@ * @@ -30,6 +30,12 @@ /*----- Revision history --------------------------------------------------* * * $Log: mdwopt.c,v $ + * Revision 1.7 1999/06/18 21:59:46 mdw + * Fix stupid bug which only read one word from environment variables. + * + * Revision 1.6 1999/05/20 23:00:42 mdw + * Little formatting things. + * * Revision 1.5 1999/05/19 20:23:59 mdw * Change naming to match newer mLib conventions. * @@ -130,9 +136,9 @@ static char *nextWord(int argc, char *const *argv, mdwopt_data *data) q = p; while (*p && !isspace((unsigned char)*p)) p++; - data->env = p; if (*p) *p++ = 0; + data->env = p; if (p != q) return (q); data->env = 0; @@ -388,9 +394,10 @@ static const char *findOpt(int o, const char *shortopt, * * If the flag @OPTF_ENVVAR@ is set on entry, options will be * extracted from an environment variable whose name is built by - * capitalising all the letters of the program's name. (This + * capitalizing all the letters of the program's name. (This * allows a user to have different default settings for a - * program, by calling it through different symbolic links.) */ + * program, by calling it through different symbolic links.) + */ int mdwopt(int argc, char *const *argv, const char *shortopt,