commit bash-20141003 snapshot

This commit is contained in:
Chet Ramey
2014-10-09 20:25:14 -04:00
parent 30595b57d9
commit 613d4ba419
30 changed files with 6247 additions and 29 deletions
+22 -1
View File
@@ -245,15 +245,36 @@ check_identifier (word, check_word)
return (1);
}
/* Return 1 if STRING is a function name that the shell will import from
the environment. Currently we reject attempts to import shell functions
containing slashes, beginning with newlines or containing blanks. In
Posix mode, we require that STRING be a valid shell identifier. Not
used yet. */
int
legal_function_name (string)
importable_function_name (string, len)
char *string;
size_t len;
{
if (absolute_program (string)) /* don't allow slash */
return 0;
if (*string == '\n') /* can't start with a newline */
return 0;
if (shellblank (*string) || shellblank(string[len-1]))
return 0;
return (posixly_correct ? legal_identifier (string) : 1);
}
int
exportable_function_name (string)
char *string;
{
if (absolute_program (string))
return 0;
if (mbschr (string, '=') != 0)
return 0;
return 1;
}
/* Return 1 if STRING comprises a valid alias name. The shell accepts
essentially all characters except those which must be quoted to the
parser (which disqualifies them from alias expansion anyway) and `/'. */