Changeset 425 for trunk/src/gmake


Ignore:
Timestamp:
Mar 26, 2006, 5:06:22 AM (19 years ago)
Author:
bird
Message:

don't bother with glob() if there are nothing to expand!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gmake/read.c

    r310 r425  
    30203020  struct nameseq *nexto;
    30213021  glob_t gl;
     3022#if defined(KMK) || defined(__EMX__) /* speed optimization */
     3023  int rc;
     3024#endif
    30223025
    30233026  dir_setup_glob (&gl);
     
    30583061#endif /* !NO_ARCHIVES */
    30593062
     3063#if defined(KMK) || defined(__EMX__) /* speed optimization */
     3064      if (!strpbrk(old->name, "*?["))
     3065        {
     3066          gl.gl_pathc = 1;
     3067          gl.gl_pathv = &old->name;
     3068        }
     3069      else
     3070        rc = glob (old->name, GLOB_NOCHECK|GLOB_ALTDIRFUNC, NULL, &gl);
     3071      switch (rc)
     3072#else
    30603073      switch (glob (old->name, GLOB_NOCHECK|GLOB_ALTDIRFUNC, NULL, &gl))
     3074#endif
    30613075        {
    30623076        case 0:                 /* Success.  */
     
    31173131                  }
    31183132              }
     3133#if defined(KMK) || defined(__EMX__) /* speed optimization */
     3134            if (gl.gl_pathv != &old->name)
     3135#endif
    31193136            globfree (&gl);
    31203137            free (old->name);
Note: See TracChangeset for help on using the changeset viewer.