You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by bn...@apache.org on 2002/04/22 23:22:21 UTC

cvs commit: apr/file_io/netware filestat.c

bnicholes    02/04/22 14:22:21

  Modified:    file_io/netware filestat.c
  Log:
  Implemented the case matching to disk of the file and directory names.
  
  Revision  Changes    Path
  1.8       +26 -3     apr/file_io/netware/filestat.c
  
  Index: filestat.c
  ===================================================================
  RCS file: /home/cvs/apr/file_io/netware/filestat.c,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- filestat.c	20 Mar 2002 08:54:42 -0000	1.7
  +++ filestat.c	22 Apr 2002 21:22:21 -0000	1.8
  @@ -53,6 +53,7 @@
    */
   
   #include "fileio.h"
  +#include "nks/dirio.h"
   #include "apr_file_io.h"
   #include "apr_general.h"
   #include "apr_strings.h"
  @@ -108,7 +109,29 @@
   
   char *case_filename(apr_pool_t *pPool, const char *szFile)
   {
  -    return (char*)szFile;
  +    char *casedFileName = NULL;
  +#ifdef WAIT_TO_IMPLEMENT
  +    char buf[1024];
  +    NXDirAttrWithName_t	*attrBuf;
  +    int rc;
  +
  +    attrBuf = (NXDirAttrWithName_t *) &buf;
  +    rc =NXGetAttr(NULL, szFile, NX_DELEVEL_NAME_ONLY, attrBuf, 1024, 0);
  +    if (rc == 0) {
  +        casedFileName = apr_pstrdup(pPool, attrBuf->deName);
  +    }
  +    else
  +#endif
  +    {
  +        char *s;
  +        s = strrchr(szFile, '/');
  +        if (!s)
  +            s = strrchr(szFile, ':');
  +        if (s) {
  +            casedFileName = apr_pstrdup(pPool, &s[1]);
  +        }
  +    }
  +    return casedFileName;
   }
   
   
  @@ -303,9 +326,9 @@
           if (wanted & APR_FINFO_LINK)
               wanted &= ~APR_FINFO_LINK;
           if (wanted & APR_FINFO_NAME) {
  -            s = strrchr(case_filename(pool, fname), '/');
  +            s = case_filename(pool, fname);
               if (s) {
  -                finfo->name = apr_pstrdup(pool, &s[1]);
  +                finfo->name = s;
                   finfo->valid |= APR_FINFO_NAME;
               }
           }