die_if_bad_username: shrink: 88 -> 77 bytes
This commit is contained in:
parent
dd5702d696
commit
104d544fd7
@ -18,17 +18,19 @@
|
||||
|
||||
void die_if_bad_username(const char *name)
|
||||
{
|
||||
int i = 0;
|
||||
|
||||
goto skip; /* 1st char being dash isn't valid */
|
||||
do {
|
||||
if (!isalnum(*name)
|
||||
&& !(*name == '_')
|
||||
&& !(*name == '.')
|
||||
&& !(*name == '@')
|
||||
&& !(*name == '-' && i)
|
||||
&& !(*name == '$' && !*(name + 1))
|
||||
)
|
||||
if (*name == '-')
|
||||
continue;
|
||||
skip:
|
||||
if (isalnum(*name)
|
||||
|| *name == '_'
|
||||
|| *name == '.'
|
||||
|| *name == '@'
|
||||
|| (*name == '$' && !*(name + 1))
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
bb_error_msg_and_die("illegal character '%c'", *name);
|
||||
i++;
|
||||
} while (*++name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user