Ignore:
Timestamp:
Nov 21, 2013, 1:11:08 AM (12 years ago)
Author:
bird
Message:

kmk/WindowsNT: Avoiding unnecessary stat() calls. Reimplemented stat(), lstat(), fstat(), opendir(), readdir(), and closedir() using native NT APIs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/function.c

    r2698 r2702  
    44384438                  const char *src = comp;
    44394439                  const char *end = strchr (comp, PATH_SEPARATOR_CHAR);
    4440                   size_t comp_len = end ? (size_t)(end - comp) : strlen (comp);
    4441                   if (!comp_len)
     4440                  size_t src_len = end ? (size_t)(end - comp) : strlen (comp);
     4441                  if (!src_len)
    44424442                    {
    4443                       comp_len = 1;
     4443                      src_len = 1;
    44444444                      src = ".";
    44454445                    }
    4446                   if (len + comp_len + 2 + 4 < GET_PATH_MAX) /* +4 for .exe */
     4446                  if (len + src_len + 2 + 4 < GET_PATH_MAX) /* +4 for .exe */
    44474447                    {
    4448                       memcpy (buf, comp, comp_len);
    4449                       buf [comp_len] = '/';
    4450                       memcpy (&buf[comp_len + 1], cur, len);
    4451                       buf[comp_len + 1 + len] = '\0';
     4448                      memcpy (buf, src, src_len);
     4449                      buf [src_len] = '/';
     4450                      memcpy (&buf[src_len + 1], cur, len);
     4451                      buf[src_len + 1 + len] = '\0';
    44524452
    44534453                      if (func_which_test_x (buf))
Note: See TracChangeset for help on using the changeset viewer.