aboutsummaryrefslogtreecommitdiff
path: root/shell/hush.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-01-13 18:22:35 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2010-01-13 18:22:35 +0100
commit25d9b91d94688b9b022224b95c06cbd4b75da085 (patch)
tree6d3b5dd63f3fab3fba018c73ae4bc64e5a38b150 /shell/hush.c
parent03d81ef43aca1808255d1a2a19ec394ed805eee8 (diff)
downloadbusybox-w32-25d9b91d94688b9b022224b95c06cbd4b75da085.tar.gz
busybox-w32-25d9b91d94688b9b022224b95c06cbd4b75da085.tar.bz2
busybox-w32-25d9b91d94688b9b022224b95c06cbd4b75da085.zip
shell/read: check that variable names are sane
function old new delta shell_builtin_read 1000 1055 +55 parse_command 1460 1463 +3 builtin_umask 121 123 +2 is_well_formed_var_name 73 66 -7 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/hush.c')
-rw-r--r--shell/hush.c10
1 files changed, 0 insertions, 10 deletions
diff --git a/shell/hush.c b/shell/hush.c
index bb0ab8408..810009ae8 100644
--- a/shell/hush.c
+++ b/shell/hush.c
@@ -893,16 +893,6 @@ static void cmdedit_update_prompt(void);
893 893
894/* Utility functions 894/* Utility functions
895 */ 895 */
896static int is_well_formed_var_name(const char *s, char terminator)
897{
898 if (!s || !(isalpha(*s) || *s == '_'))
899 return 0;
900 s++;
901 while (isalnum(*s) || *s == '_')
902 s++;
903 return *s == terminator;
904}
905
906/* Replace each \x with x in place, return ptr past NUL. */ 896/* Replace each \x with x in place, return ptr past NUL. */
907static char *unbackslash(char *src) 897static char *unbackslash(char *src)
908{ 898{