From: Kai Tietz Date: Sat, 27 Oct 2012 12:09:38 +0000 (+0000) Subject: * dcrt0.cc (quoted): Renamed strechr to strchrnul. X-Git-Tag: sid-snapshot-20121101~5 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=f71f133bda3077c835de51e76e83f674d45297ae;p=newlib-cygwin.git * dcrt0.cc (quoted): Renamed strechr to strchrnul. * environ.cc (environ_init): Likewise. * sec_acl.cc (aclfromtext32): Likewise. * sec_auth.cc (extract_nt_dom_user): Likewise. * uinfo.cc (pwdgrp::next_str): Likewise. * string.h (strechr): Likewise. --- diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index b76166b7a..133caeea7 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,12 @@ +2012-10-27 Kai Tietz + + * dcrt0.cc (quoted): Renamed strechr to strchrnul. + * environ.cc (environ_init): Likewise. + * sec_acl.cc (aclfromtext32): Likewise. + * sec_auth.cc (extract_nt_dom_user): Likewise. + * uinfo.cc (pwdgrp::next_str): Likewise. + * string.h (strechr): Likewise. + 2012-10-26 Kai Tietz * string.h (strechr): Replace assembler by diff --git a/winsup/cygwin/dcrt0.cc b/winsup/cygwin/dcrt0.cc index 0cda2e5d5..1f5ffbf7b 100644 --- a/winsup/cygwin/dcrt0.cc +++ b/winsup/cygwin/dcrt0.cc @@ -162,7 +162,7 @@ quoted (char *cmd, int winshell) { char *p; strcpy (cmd, cmd + 1); - if (*(p = strechr (cmd, quote))) + if (*(p = strchrnul (cmd, quote))) strcpy (p, p + 1); return p; } diff --git a/winsup/cygwin/environ.cc b/winsup/cygwin/environ.cc index ae3944a6c..4b33b743a 100644 --- a/winsup/cygwin/environ.cc +++ b/winsup/cygwin/environ.cc @@ -829,7 +829,7 @@ environ_init (char **envp, int envc) envp[i] = newp; if (*newp == '=') *newp = '!'; - char *eq = strechr (newp, '='); + char *eq = strchrnul (newp, '='); ucenv (newp, eq); /* uppercase env vars which need it */ if (*newp == 'T' && strncmp (newp, "TERM=", 5) == 0) sawTERM = 1; diff --git a/winsup/cygwin/sec_acl.cc b/winsup/cygwin/sec_acl.cc index 14cb88667..8ce43fe28 100644 --- a/winsup/cygwin/sec_acl.cc +++ b/winsup/cygwin/sec_acl.cc @@ -861,7 +861,7 @@ aclfromtext32 (char *acltextp, int *) return NULL; } lacl[pos].a_id = pw->pw_uid; - c = strechr (c, ':'); + c = strchrnul (c, ':'); } else if (isdigit (*c)) lacl[pos].a_id = strtol (c, &c, 10); @@ -889,7 +889,7 @@ aclfromtext32 (char *acltextp, int *) return NULL; } lacl[pos].a_id = gr->gr_gid; - c = strechr (c, ':'); + c = strchrnul (c, ':'); } else if (isdigit (*c)) lacl[pos].a_id = strtol (c, &c, 10); diff --git a/winsup/cygwin/sec_auth.cc b/winsup/cygwin/sec_auth.cc index 26f276b84..15bdf7b7b 100644 --- a/winsup/cygwin/sec_auth.cc +++ b/winsup/cygwin/sec_auth.cc @@ -120,8 +120,8 @@ extract_nt_dom_user (const struct passwd *pw, PWCHAR domain, PWCHAR user) if ((d = strstr (pw->pw_gecos, "U-")) != NULL && (d == pw->pw_gecos || d[-1] == ',')) { - c = strechr (d + 2, ','); - if ((u = strechr (d + 2, '\\')) >= c) + c = strchrnul (d + 2, ','); + if ((u = strchrnul (d + 2, '\\')) >= c) u = d + 1; else if (u - d <= MAX_DOMAIN_NAME_LEN + 2) sys_mbstowcs (domain, MAX_DOMAIN_NAME_LEN + 1, d + 2, u - d - 1); diff --git a/winsup/cygwin/string.h b/winsup/cygwin/string.h index 70f6f4e45..bb0375ccb 100644 --- a/winsup/cygwin/string.h +++ b/winsup/cygwin/string.h @@ -17,10 +17,10 @@ details. */ extern "C" { #endif -#undef strechr -#define strechr cygwin_strechr +#undef strchrnul +#define strchrnul cygwin_strchrnul static inline __stdcall char * -strechr (const char *s, int c) +strchrnul (const char *s, int c) { while (*s != (char) c && *s != 0) ++s; diff --git a/winsup/cygwin/uinfo.cc b/winsup/cygwin/uinfo.cc index a26ccb88e..a83d1080d 100644 --- a/winsup/cygwin/uinfo.cc +++ b/winsup/cygwin/uinfo.cc @@ -489,7 +489,7 @@ char * pwdgrp::next_str (char c) { char *res = lptr; - lptr = strechr (lptr, c); + lptr = strchrnul (lptr, c); if (*lptr) *lptr++ = '\0'; return res;