summaryrefslogtreecommitdiff
path: root/shell/ash.c
diff options
context:
space:
mode:
authorDenys Vlasenko2013-02-26 00:36:53 +0100
committerDenys Vlasenko2013-02-26 00:36:53 +0100
commit1961aea305e258ba7ab3910d084451220f55ed44 (patch)
treebd889c8e596051c187b93af9c50508c6009f2683 /shell/ash.c
parent3305c008ed6084f58b59dde5198ae92e3a458e46 (diff)
downloadbusybox-1961aea305e258ba7ab3910d084451220f55ed44.zip
busybox-1961aea305e258ba7ab3910d084451220f55ed44.tar.gz
move endofname() to libbb
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'shell/ash.c')
-rw-r--r--shell/ash.c24
1 files changed, 3 insertions, 21 deletions
diff --git a/shell/ash.c b/shell/ash.c
index 31fbc55..0b5111a 100644
--- a/shell/ash.c
+++ b/shell/ash.c
@@ -385,6 +385,9 @@ static void trace_vprintf(const char *fmt, va_list va);
/* ============ Utility functions */
#define xbarrier() do { __asm__ __volatile__ ("": : :"memory"); } while (0)
+#define is_name(c) ((c) == '_' || isalpha((unsigned char)(c)))
+#define is_in_name(c) ((c) == '_' || isalnum((unsigned char)(c)))
+
static int isdigit_str9(const char *str)
{
int maxlen = 9 + 1; /* max 9 digits: 999999999 */
@@ -2008,27 +2011,6 @@ getoptsreset(const char *value)
}
#endif
-/* math.h has these, otherwise define our private copies */
-#if !ENABLE_SH_MATH_SUPPORT
-#define is_name(c) ((c) == '_' || isalpha((unsigned char)(c)))
-#define is_in_name(c) ((c) == '_' || isalnum((unsigned char)(c)))
-/*
- * Return the pointer to the first char which is not part of a legal variable name
- * (a letter or underscore followed by letters, underscores, and digits).
- */
-static const char*
-endofname(const char *name)
-{
- if (!is_name(*name))
- return name;
- while (*++name) {
- if (!is_in_name(*name))
- break;
- }
- return name;
-}
-#endif
-
/*
* Compares two strings up to the first = or '\0'. The first
* string must be terminated by '='; the second may be terminated by