On Sat, Apr 18, 2015 at 08:36:45AM -0400, Karl Dahlke wrote: > > I notice you miss out the ~whatever expansion here, > > No, I get that for free. > It's handled by glob(). > And it works, and it's pretty cool. > I don't have a lot of use for it but I like it. Ok, never knew glob did that, that's cool. One thing puzzles me about the changes though: /* But first see if the user wants to glob */ if (varline[0] == '~') { char c = varline[1]; if (!c) goto doglob; if (c == '/') goto doglob; if (isalphaByte(c)) goto doglob; } for (s = varline; *s; ++s) if (strchr("*?[", *s) && (s == varline || s[-1] != '\\')) goto doglob; noglob: *expanded = varline; return true; I thought we were using globbing so that we didn't have nasty side-effects, and I'm not entirely sure what this check solves. If there are metacharacters in the expanded line by this point and they're unescaped then we'll glob, otherwise they're correctly escaped and thus globbing wouldn't do any harm anyway. In addition glob appears to handle a ] without a [ etc, so again this check seems somewhat redundant. As for the r5 (or r) problem which is what I guess this is trying to solve, that number shouldn't have gone anywhere near this function since, as far as I know, r is illegal and should be r anyway. Cheers, Adam.