On Wed, 2011-04-06 at 12:35 +0100, Michael Meeks wrote:
> These ~all come from calling 'glob'; I append a patch that tries to
> call glob only if needed - it could be done more prettily:

That's interesting.  I wonder why the glob expansion is so inefficient;
I would expect it to do the same kinds of checks that you're doing (that
is, basically be a string-walk unless a glob character is found).

> +need_to_glob (const char *name)
> +{
> +  int i;
> +  for (i = 0; name[i] != '\0'; i++) {
> +    if (name[i] == '?' || name[i] == '*' || name[i] == '[') {
> +      return 1;
> +    }
> +  }
> +  return 0;
> +}

Why not just use strpbrk()?

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <psm...@gnu.org>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.mad-scientist.net
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist


_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to