diff options
Diffstat (limited to 'openbsd-compat/glob.c')
-rw-r--r-- | openbsd-compat/glob.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c index 1e346a8f6..e89151789 100644 --- a/openbsd-compat/glob.c +++ b/openbsd-compat/glob.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: glob.c,v 1.48 2019/02/04 16:45:40 millert Exp $ */ | 1 | /* $OpenBSD: glob.c,v 1.49 2020/04/21 08:25:22 dtucker Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 1989, 1993 | 3 | * Copyright (c) 1989, 1993 |
4 | * The Regents of the University of California. All rights reserved. | 4 | * The Regents of the University of California. All rights reserved. |
@@ -83,6 +83,10 @@ | |||
83 | 83 | ||
84 | #include "charclass.h" | 84 | #include "charclass.h" |
85 | 85 | ||
86 | #ifdef TILDE | ||
87 | # undef TILDE | ||
88 | #endif | ||
89 | |||
86 | #define DOLLAR '$' | 90 | #define DOLLAR '$' |
87 | #define DOT '.' | 91 | #define DOT '.' |
88 | #define EOS '\0' | 92 | #define EOS '\0' |
@@ -829,7 +833,7 @@ globextend(const Char *path, glob_t *pglob, struct glob_lim *limitp, | |||
829 | if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { | 833 | if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { |
830 | /* first time around -- clear initial gl_offs items */ | 834 | /* first time around -- clear initial gl_offs items */ |
831 | pathv += pglob->gl_offs; | 835 | pathv += pglob->gl_offs; |
832 | for (i = pglob->gl_offs; --i >= 0; ) | 836 | for (i = pglob->gl_offs; i > 0; i--) |
833 | *--pathv = NULL; | 837 | *--pathv = NULL; |
834 | } | 838 | } |
835 | pglob->gl_pathv = pathv; | 839 | pglob->gl_pathv = pathv; |
@@ -841,7 +845,7 @@ globextend(const Char *path, glob_t *pglob, struct glob_lim *limitp, | |||
841 | if (pglob->gl_statv == NULL && pglob->gl_offs > 0) { | 845 | if (pglob->gl_statv == NULL && pglob->gl_offs > 0) { |
842 | /* first time around -- clear initial gl_offs items */ | 846 | /* first time around -- clear initial gl_offs items */ |
843 | statv += pglob->gl_offs; | 847 | statv += pglob->gl_offs; |
844 | for (i = pglob->gl_offs; --i >= 0; ) | 848 | for (i = pglob->gl_offs; i > 0; i--) |
845 | *--statv = NULL; | 849 | *--statv = NULL; |
846 | } | 850 | } |
847 | pglob->gl_statv = statv; | 851 | pglob->gl_statv = statv; |