apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wr...@apache.org
Subject cvs commit: apr/user/win32 userinfo.c
Date Sun, 10 Jun 2001 19:53:28 GMT
wrowe       01/06/10 12:53:28

  Modified:    user/win32 userinfo.c
  Log:
    Better make the path canonical to unixish expectations.
    This is verified to allow mod_userdir do it's thing on win32.
  
  Revision  Changes    Path
  1.12      +8 -6      apr/user/win32/userinfo.c
  
  Index: userinfo.c
  ===================================================================
  RCS file: /home/cvs/apr/user/win32/userinfo.c,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- userinfo.c	2001/06/10 19:44:02	1.11
  +++ userinfo.c	2001/06/10 19:53:28	1.12
  @@ -106,6 +106,7 @@
       apr_oslevel_e os_level;
       apr_status_t rv;
       char regkey[MAX_PATH * 2];
  +    char *fixch;
       DWORD keylen;
       DWORD type;
       HKEY key;
  @@ -149,7 +150,6 @@
                                              (apr_wchar_t*)regkey)) != APR_SUCCESS)
                   return rv;
               *dirname = apr_pstrdup(p, retdir);
  -            return APR_SUCCESS;
           }
           else if (type == REG_EXPAND_SZ) {
               apr_wchar_t path[MAX_PATH];
  @@ -159,9 +159,9 @@
                       != APR_SUCCESS)
                   return rv;
               *dirname = apr_pstrdup(p, retdir);
  -            return APR_SUCCESS;
           }
  -        return APR_ENOENT;
  +        else
  +            return APR_ENOENT;
       }
       else
   #endif APR_HAS_UNICODE_FS
  @@ -174,16 +174,18 @@
               return APR_FROM_OS_ERROR(rv);
           if (type == REG_SZ) {
               *dirname = apr_pstrdup(p, regkey);
  -            return APR_SUCCESS;
           }
           else if (type == REG_EXPAND_SZ) {
               char path[MAX_PATH];
               ExpandEnvironmentStrings(regkey, path, sizeof(path));
               *dirname = apr_pstrdup(p, path);
  -            return APR_SUCCESS;
           }
  -        return APR_ENOENT;
  +        else
  +            return APR_ENOENT;
       }
  +    for (fixch = *dirname; *fixch; ++fixch)
  +        if (*fixch == '\\')
  +            *fixch = '/';
   }
   
   APR_DECLARE(apr_status_t) apr_get_userid(apr_uid_t *uid, apr_gid_t *gid,
  
  
  

Mime
View raw message