← Commit list

68286770b

Rob Landley
Rob Landley
2006-06-13
SOURCE BUG Duration: 33s

Subject

Patch from Shaun Jackman to detect "name=value" variable assignments. Random cleanup at the end by me to make some unrelated #ifdefs go away...

SOURCE BUG

This commit was genuinely broken at the time (not related to our build system): scripts/config/mkconfigs.c (2005-08-01 - 2006-10-05 arasi) uretilen bbconfigopts.h icine .config satirlarini kacissiz, ham newline'larla gömüyordu - gecerli C degildi, busybox'un kendi bb_mkdep araci bile parse edemiyordu (7d219aab7 ile duzeltildi, mkconfigs shell scripte cevrildi)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

shell/lash.c+11 -10
@@ -1182,9 +1182,12 @@ static int parse_command(char **command_ptr, struct job *job, int *inbg)
static int pseudo_exec(struct child_prog *child)
{
struct built_in_command *x;
-#ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL
- char *name;
-#endif
+
+ /* Check if the command sets an environment variable. */
+ if( strchr(child->argv[0], '=') != NULL ) {
+ child->argv[1] = child->argv[0];
+ _exit(builtin_export(child));
+ }
/* Check if the command matches any of the non-forking builtins.
* Depending on context, this might be redundant. But it's
@@ -1204,7 +1207,7 @@ static int pseudo_exec(struct child_prog *child)
_exit (x->function(child));
}
}
-#ifdef CONFIG_FEATURE_SH_STANDALONE_SHELL
+
/* Check if the command matches any busybox internal
* commands ("applets") here. Following discussions from
* November 2000 on [email protected], don't use
@@ -1216,17 +1219,15 @@ static int pseudo_exec(struct child_prog *child)
* /bin/foo invocation will fork and exec /bin/foo, even if
* /bin/foo is a symlink to busybox.
*/
- name = child->argv[0];
- {
- char** argv_l=child->argv;
+ if (ENABLE_FEATURE_SH_STANDALONE_SHELL) {
+ char **argv_l = child->argv;
int argc_l;
- for(argc_l=0;*argv_l!=NULL; argv_l++, argc_l++);
+ for(argc_l=0; *argv_l; argv_l++, argc_l++);
optind = 1;
- run_applet_by_name(name, argc_l, child->argv);
+ run_applet_by_name(child->argv[0], argc_l, child->argv);
}
-#endif
execvp(child->argv[0], child->argv);