~mdw
/
cfd
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix stupid bug which only read one word from environment variables.
[cfd]
/
mdwopt.c
diff --git
a/mdwopt.c
b/mdwopt.c
index
6814e99
..
1717d2d
100644
(file)
--- a/
mdwopt.c
+++ b/
mdwopt.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-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@
*
*
* Options parsing, similar to GNU @getopt_long@
*
@@
-30,6
+30,12
@@
/*----- Revision history --------------------------------------------------*
*
* $Log: mdwopt.c,v $
/*----- 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.
*
* 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++;
q = p;
while (*p && !isspace((unsigned char)*p))
p++;
- data->env = p;
if (*p)
*p++ = 0;
if (*p)
*p++ = 0;
+ data->env = p;
if (p != q)
return (q);
data->env = 0;
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
*
* If the flag @OPTF_ENVVAR@ is set on entry, options will be
* extracted from an environment variable whose name is built by
- * capitali
s
ing all the letters of the program's name. (This
+ * capitali
z
ing all the letters of the program's name. (This
* allows a user to have different default settings for a
* 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,
int mdwopt(int argc, char *const *argv,
const char *shortopt,