comparison lib/userspec.c @ 475:7e3e0dd559c7

(isnumber): Rename to is_number. (parse_user_spec): Rename uses, too.
author Jim Meyering <jim@meyering.net>
date Sat, 05 Aug 1995 03:13:16 +0000
parents a56993d69333
children 62aa0b766a11
comparison
equal deleted inserted replaced
474:a729620f36b6 475:7e3e0dd559c7
86 86
87 /* Return nonzero if STR represents an unsigned decimal integer, 87 /* Return nonzero if STR represents an unsigned decimal integer,
88 otherwise return 0. */ 88 otherwise return 0. */
89 89
90 static int 90 static int
91 isnumber (str) 91 is_number (str)
92 const char *str; 92 const char *str;
93 { 93 {
94 for (; *str; str++) 94 for (; *str; str++)
95 if (!isdigit (*str)) 95 if (!isdigit (*str))
96 return 0; 96 return 0;
154 { 154 {
155 pwd = getpwnam (u); 155 pwd = getpwnam (u);
156 if (pwd == NULL) 156 if (pwd == NULL)
157 { 157 {
158 158
159 if (!isnumber (u)) 159 if (!is_number (u))
160 error_msg = "invalid user"; 160 error_msg = "invalid user";
161 else 161 else
162 { 162 {
163 int use_login_group; 163 int use_login_group;
164 use_login_group = (separator != NULL && g == NULL); 164 use_login_group = (separator != NULL && g == NULL);
200 { 200 {
201 /* Explicit group. */ 201 /* Explicit group. */
202 grp = getgrnam (g); 202 grp = getgrnam (g);
203 if (grp == NULL) 203 if (grp == NULL)
204 { 204 {
205 if (!isnumber (g)) 205 if (!is_number (g))
206 error_msg = "invalid group"; 206 error_msg = "invalid group";
207 else 207 else
208 *gid = atoi (g); 208 *gid = atoi (g);
209 } 209 }
210 else 210 else