On Tuesday 19 February 2008 13:57, Cristian Ionescu-Idbohrn wrote:
> This kills the shell too:
>
> # echo $RUNLEVEL
> 3
> # for file in /etc/rc$RUNLEVEL.d/S??*; do echo $file;done
> sh (pid 82) segfaults for page address 20188000 at pc 355a06a6
>
> But this line:
>
> for file in /etc/rc3.d/S??*; do echo $file;done
>
> works as expected.
Here:
/* "A=a B=$A" case: var_str_list is a list of "A=a" strings
* which should be considered before we check variables. */
if (var_str_list) {
Does it work again yf you replace "if (var_str_list)" with "if (0)"?
If yes, can you add lots of bb_error_msg("LINE %d", __LINE__)
to the body of the "if" and find out where it dies?
+ if (var_str_list) {
+ unsigned name_len = (strchrnul(name, '=') - name) + 1;
+ p = NULL;
+ do {
+ char *str = var_str_list->text;
+ char *eq = strchr(str, '=');
+ if (!eq) /* stop at first non-assignment */
+ break;
+ eq++;
+ if (name_len == (eq - str)
+ && strncmp(str, name, name_len) == 0) {
+ p = eq;
+ /* goto value; - WRONG! */
+ /* think "A=1 A=2 B=$A" */
+ }
+ var_str_list = var_str_list->next;
+ } while (var_str_list);
+ if (p)
+ goto value;
+ }
--
vda
_______________________________________________
busybox mailing list
[email protected]
http://busybox.net/cgi-bin/mailman/listinfo/busybox