More useful macros added.
[cfd] / mdwopt.c
index 6814e99..1717d2d 100644 (file)
--- 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@
  *
 /*----- 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,