jwoolley 01/02/21 20:16:55
Modified: . CHANGES
user/win32 userinfo.c
Log:
Remove some duplicate calls to strchr(), and remove a typo as a side-effect
Revision Changes Path
1.68 +1 -1 apr/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apr/CHANGES,v
retrieving revision 1.67
retrieving revision 1.68
diff -u -d -u -r1.67 -r1.68
--- CHANGES 2001/02/21 23:38:41 1.67
+++ CHANGES 2001/02/22 04:16:54 1.68
@@ -1,7 +1,7 @@
Changes with APR b1
*) Introduce apr_get_userid to return a named user's apr_uid_t and
- apr_gid_t across platforms [cliff Woolley, William Rowe]
+ apr_gid_t across platforms [Cliff Woolley, William Rowe]
*) In apr_shm_init(), check the retcode from mm_malloc(). Previously,
we segfaulted here if mm_malloc() failed to get a lock. An example
1.6 +7 -6 apr/user/win32/userinfo.c
Index: userinfo.c
===================================================================
RCS file: /home/cvs/apr/user/win32/userinfo.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -u -r1.5 -r1.6
--- userinfo.c 2001/02/21 23:38:45 1.5
+++ userinfo.c 2001/02/22 04:16:55 1.6
@@ -71,14 +71,15 @@
SID_NAME_USE sidtype;
char *domain = NULL;
DWORD sidlen, rv;
+ char *pos;
- if (strchr(username, '/')) {
- domain = apr_pstrndup(p, username, strchr(username, '/') - username);
- username += strlen(domain) + 1;
+ if (pos = strchr(username, '/')) {
+ domain = apr_pstrndup(p, username, pos - username);
+ username = pos + 1;
}
- else if (strchr(username, '\\')) {
- domain = apr_pstrndup(p, username, strchr(username, '/') - username);
- username += strlen(domain) + 1;
+ else if (pos = strchr(username, '\\')) {
+ domain = apr_pstrndup(p, username, pos - username);
+ username = pos + 1;
}
/* Get nothing on the first pass ... need to size the sid buffer
*/