Bug assignment not found

Meihui Fan mhfan at hhcn.com
Fri Mar 23 14:17:09 UTC 2007


Hi,

The recent msh in busybox can not accept a variable with `_' and
complaint the whole assignment `not found'. e.g.:

# foo_foo=foo
foo_foo=foo: not found

The bug in the code is apparent. The following inlined patch will fix it.

Index: msh.c
===================================================================
--- msh.c       (revision 18212)
+++ msh.c       (working copy)
@@ -1205,7 +1205,7 @@
                if (c == '=')
                        return 1;
                c |= 0x20; /* lowercase letters, doesn't affect numbers */
-               if (c != '_'
+               if (c != (0x20 | '_')
                 && (unsigned)(c - '0') > 9  /* not number */
                 && (unsigned)(c - 'a') > 25 /* not letter */
                ) {


-- 
Best Regards,
范美辉 (Meihui Fan)
Chief Engineer
Software Engineering Department
Tel: +86-551-5333155/156/157,5325173
FAX: +86-551-5325323
Products Info. : http://www.hhcn.com
Tech. Support  : http://bbs.hhcn.com
HHTech : An Embedded Linux Tech. Provider in Mainland China




More information about the busybox mailing list