Lines 2904-2909
parse_file_seq (char **stringp, unsigned int size, int stopchar,
Link Here
|
2904 |
const char *name; |
2904 |
const char *name; |
2905 |
const char **nlist = 0; |
2905 |
const char **nlist = 0; |
2906 |
char *tildep = 0; |
2906 |
char *tildep = 0; |
|
|
2907 |
int globme = 1; |
2907 |
#ifndef NO_ARCHIVES |
2908 |
#ifndef NO_ARCHIVES |
2908 |
char *arname = 0; |
2909 |
char *arname = 0; |
2909 |
char *memname = 0; |
2910 |
char *memname = 0; |
Lines 3112-3143
parse_file_seq (char **stringp, unsigned int size, int stopchar,
Link Here
|
3112 |
} |
3113 |
} |
3113 |
#endif /* !NO_ARCHIVES */ |
3114 |
#endif /* !NO_ARCHIVES */ |
3114 |
|
3115 |
|
3115 |
switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl)) |
3116 |
/* glob() is expensive: don't call it unless we need to. */ |
3116 |
{ |
3117 |
if (!(flags & PARSEFS_EXISTS) && strpbrk (name, "?*[") == NULL) |
3117 |
case GLOB_NOSPACE: |
3118 |
{ |
3118 |
fatal (NILF, _("virtual memory exhausted")); |
3119 |
globme = 0; |
|
|
3120 |
i = 1; |
3121 |
nlist = &name; |
3122 |
} |
3123 |
else |
3124 |
switch (glob (name, GLOB_NOSORT|GLOB_ALTDIRFUNC, NULL, &gl)) |
3125 |
{ |
3126 |
case GLOB_NOSPACE: |
3127 |
fatal (NILF, _("virtual memory exhausted")); |
3119 |
|
3128 |
|
3120 |
case 0: |
3129 |
case 0: |
3121 |
/* Success. */ |
3130 |
/* Success. */ |
3122 |
i = gl.gl_pathc; |
3131 |
i = gl.gl_pathc; |
3123 |
nlist = (const char **)gl.gl_pathv; |
3132 |
nlist = (const char **)gl.gl_pathv; |
3124 |
break; |
3133 |
break; |
3125 |
|
3134 |
|
3126 |
case GLOB_NOMATCH: |
3135 |
case GLOB_NOMATCH: |
3127 |
/* If we want only existing items, skip this one. */ |
3136 |
/* If we want only existing items, skip this one. */ |
3128 |
if (flags & PARSEFS_EXISTS) |
3137 |
if (flags & PARSEFS_EXISTS) |
3129 |
{ |
3138 |
{ |
3130 |
i = 0; |
3139 |
i = 0; |
3131 |
break; |
3140 |
break; |
3132 |
} |
3141 |
} |
3133 |
/* FALLTHROUGH */ |
3142 |
/* FALLTHROUGH */ |
3134 |
|
3143 |
|
3135 |
default: |
3144 |
default: |
3136 |
/* By default keep this name. */ |
3145 |
/* By default keep this name. */ |
3137 |
i = 1; |
3146 |
i = 1; |
3138 |
nlist = &name; |
3147 |
nlist = &name; |
3139 |
break; |
3148 |
break; |
3140 |
} |
3149 |
} |
3141 |
|
3150 |
|
3142 |
/* For each matched element, add it to the list. */ |
3151 |
/* For each matched element, add it to the list. */ |
3143 |
while (i-- > 0) |
3152 |
while (i-- > 0) |
Lines 3174-3180
parse_file_seq (char **stringp, unsigned int size, int stopchar,
Link Here
|
3174 |
#endif /* !NO_ARCHIVES */ |
3183 |
#endif /* !NO_ARCHIVES */ |
3175 |
NEWELT (concat (2, prefix, nlist[i])); |
3184 |
NEWELT (concat (2, prefix, nlist[i])); |
3176 |
|
3185 |
|
3177 |
globfree (&gl); |
3186 |
if (globme) |
|
|
3187 |
globfree (&gl); |
3178 |
|
3188 |
|
3179 |
#ifndef NO_ARCHIVES |
3189 |
#ifndef NO_ARCHIVES |
3180 |
if (arname) |
3190 |
if (arname) |
3181 |
- |
|
|