physfs.c
changeset 684 435510363ae4
parent 683 e724adb731df
child 685 f2aee9b67a4f
equal deleted inserted replaced
683:e724adb731df 684:435510363ae4
  1239     {
  1239     {
  1240         /* !!! FIXME: Case insensitive? */
  1240         /* !!! FIXME: Case insensitive? */
  1241         size_t mntpntlen = strlen(h->mountPoint);
  1241         size_t mntpntlen = strlen(h->mountPoint);
  1242         assert(mntpntlen > 1); /* root mount points should be NULL. */
  1242         assert(mntpntlen > 1); /* root mount points should be NULL. */
  1243         size_t len = strlen(fname);
  1243         size_t len = strlen(fname);
  1244         if (len < mntpntlen)
  1244         /* not under the mountpoint, so skip this archive. */
  1245             return(0); /* not under the mountpoint, so skip this archive. */
  1245         BAIL_IF_MACRO(len < mntpntlen, ERR_NO_SUCH_PATH, 0);
  1246         if (strncmp(h->mountPoint, fname, mntpntlen) != 0)
  1246         retval = strncmp(h->mountPoint, fname, mntpntlen);
  1247             return(0);  /* not under the mountpoint, so skip this archive. */
  1247         BAIL_IF_MACRO(retval != 0, ERR_NO_SUCH_PATH, 0);
  1248 
       
  1249         fname += mntpntlen;  /* move to start of actual archive path. */
  1248         fname += mntpntlen;  /* move to start of actual archive path. */
       
  1249         retval = 1;
  1250     } /* if */
  1250     } /* if */
  1251 
  1251 
  1252     /* !!! FIXME: Can we ditch this malloc()? */
  1252     /* !!! FIXME: Can we ditch this malloc()? */
  1253     start = str = malloc(strlen(fname) + 1);
  1253     start = str = malloc(strlen(fname) + 1);
  1254     BAIL_IF_MACRO(str == NULL, ERR_OUT_OF_MEMORY, 0);
  1254     BAIL_IF_MACRO(str == NULL, ERR_OUT_OF_MEMORY, 0);