summaryrefslogtreecommitdiffhomepage
path: root/shell/shell_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'shell/shell_common.c')
-rw-r--r--shell/shell_common.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/shell/shell_common.c b/shell/shell_common.c
index 99bb91c6f..669a18dfd 100644
--- a/shell/shell_common.c
+++ b/shell/shell_common.c
@@ -19,8 +19,17 @@
#include "libbb.h"
#include "shell_common.h"
-#if IFS_BROKEN
const char defifsvar[] ALIGN1 = "IFS= \t\n";
-#else
-const char defifs[] ALIGN1 = " \t\n";
-#endif
+
+
+int FAST_FUNC is_well_formed_var_name(const char *s, char terminator)
+{
+ if (!s || !(isalpha(*s) || *s == '_'))
+ return 0;
+
+ do
+ s++;
+ while (isalnum(*s) || *s == '_');
+
+ return *s == terminator;
+}