diff --git a/include/wordexp.h b/include/wordexp.h index aee7caf32f34..b86e6f9e34b7 100644 --- a/include/wordexp.h +++ b/include/wordexp.h @@ -49,7 +49,7 @@ typedef struct { * Flags for wordexp(). */ #define WRDE_APPEND 0x1 /* append to previously generated */ -#define WRDE_DOOFS 0x2 /* we_offs member is valid */ +#define WRDE_DOOFFS 0x2 /* we_offs member is valid */ #define WRDE_NOCMD 0x4 /* disallow command substitution */ #define WRDE_REUSE 0x8 /* reuse wordexp_t */ #define WRDE_SHOWERR 0x10 /* don't redirect stderr to /dev/null */ diff --git a/lib/libc/gen/wordexp.3 b/lib/libc/gen/wordexp.3 index 7138bdcb1a82..844059d776fd 100644 --- a/lib/libc/gen/wordexp.3 +++ b/lib/libc/gen/wordexp.3 @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 27, 2002 +.Dd June 30, 2004 .Dt WORDEXP 3 .Os .Sh NAME @@ -58,7 +58,7 @@ argument is the bitwise inclusive OR of any of the following constants: .It Dv WRDE_APPEND Append the words to those generated by a previous call to .Fn wordexp . -.It Dv WRDE_DOOFS +.It Dv WRDE_DOOFFS As many .Dv NULL pointers as are specified by the diff --git a/lib/libc/gen/wordexp.c b/lib/libc/gen/wordexp.c index 46ccb2f7a1b5..a437543bca40 100644 --- a/lib/libc/gen/wordexp.c +++ b/lib/libc/gen/wordexp.c @@ -155,12 +155,12 @@ we_askshell(const char *words, wordexp_t *we, int flags) */ sofs = we->we_nbytes; vofs = we->we_wordc; - if ((flags & (WRDE_DOOFS|WRDE_APPEND)) == (WRDE_DOOFS|WRDE_APPEND)) + if ((flags & (WRDE_DOOFFS|WRDE_APPEND)) == (WRDE_DOOFFS|WRDE_APPEND)) vofs += we->we_offs; we->we_wordc += nwords; we->we_nbytes += nbytes; if ((nwv = realloc(we->we_wordv, (we->we_wordc + 1 + - (flags & WRDE_DOOFS ? we->we_offs : 0)) * + (flags & WRDE_DOOFFS ? we->we_offs : 0)) * sizeof(char *))) == NULL) { _close(pdes[0]); _waitpid(pid, &status, 0); @@ -194,7 +194,7 @@ we_askshell(const char *words, wordexp_t *we, int flags) * Break the null-terminated expanded word strings out into * the vector. */ - if (vofs == 0 && flags & WRDE_DOOFS) + if (vofs == 0 && flags & WRDE_DOOFFS) while (vofs < we->we_offs) we->we_wordv[vofs++] = NULL; p = we->we_strings + sofs;