sh.glob.c (tcsh-6.22.02) | : | sh.glob.c (tcsh-6.22.03) | ||
---|---|---|---|---|
skipping to change at line 77 | skipping to change at line 77 | |||
static void expbrace (Char ***, Char ***, int); | static void expbrace (Char ***, Char ***, int); | |||
static void pword (struct blk_buf *, struct Strbuf *); | static void pword (struct blk_buf *, struct Strbuf *); | |||
static void backeval (struct blk_buf *, struct Strbuf *, Char *, | static void backeval (struct blk_buf *, struct Strbuf *, Char *, | |||
int); | int); | |||
static Char * | static Char * | |||
globtilde(Char *s) | globtilde(Char *s) | |||
{ | { | |||
Char *name, *u, *home, *res; | Char *name, *u, *home, *res; | |||
u = s; | u = s; | |||
if (s[1] == '~') | ||||
return Strsave(s); | ||||
for (s++; *s && *s != '/' && *s != ':'; s++) | for (s++; *s && *s != '/' && *s != ':'; s++) | |||
continue; | continue; | |||
name = Strnsave(u + 1, s - (u + 1)); | name = Strnsave(u + 1, s - (u + 1)); | |||
cleanup_push(name, xfree); | cleanup_push(name, xfree); | |||
home = gethdir(name); | home = gethdir(name); | |||
if (home == NULL) { | if (home == NULL) { | |||
if (adrof(STRnonomatch)) { | if (adrof(STRnonomatch)) { | |||
cleanup_until(name); | cleanup_until(name); | |||
return u; | return u; | |||
} | } | |||
if (*name) | if (*name) | |||
stderror(ERR_UNKUSER, short2str(name)); | stderror(ERR_UNKUSER, short2str(name)); | |||
skipping to change at line 512 | skipping to change at line 517 | |||
cleanup_until(vo); | cleanup_until(vo); | |||
else | else | |||
cleanup_ignore(vo); | cleanup_ignore(vo); | |||
} | } | |||
if (vl == NULL) { | if (vl == NULL) { | |||
setname(short2str(str)); | setname(short2str(str)); | |||
stderror(ERR_NAME | ERR_NOMATCH); | stderror(ERR_NAME | ERR_NOMATCH); | |||
} | } | |||
result: | result: | |||
if (vl && vl[0] == NULL) { | if (vl && vl[0] == NULL) { | |||
xfree(vl); | if (vl != v) | |||
xfree(vl); | ||||
return (Strsave(STRNULL)); | return (Strsave(STRNULL)); | |||
} | } | |||
if (vl && vl[1]) | if (vl && vl[1]) | |||
return (handleone(str, vl, action)); | return (handleone(str, vl, action)); | |||
else { | else { | |||
str = strip(*vl); | str = strip(*vl); | |||
xfree(vl); | if (vl != v) | |||
xfree(vl); | ||||
return (str); | return (str); | |||
} | } | |||
} | } | |||
Char ** | Char ** | |||
globall(Char **v, int gflg) | globall(Char **v, int gflg) | |||
{ | { | |||
Char **vl, **vo; | Char **vl, **vo; | |||
int noglob; | int noglob; | |||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 9 lines changed or added |