aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2001-01-31 17:29:12 +0000
committerEric Andersen <andersen@codepoet.org>2001-01-31 17:29:12 +0000
commit704d2a6c433f31da079f5b0dd3395ce0255708f9 (patch)
treef50c28c75c13f6cb401343fda14313119bbdc447
parent39573f7130d423069103ad90c9cffa223715f2e2 (diff)
downloadbusybox-w32-704d2a6c433f31da079f5b0dd3395ce0255708f9.tar.gz
busybox-w32-704d2a6c433f31da079f5b0dd3395ce0255708f9.tar.bz2
busybox-w32-704d2a6c433f31da079f5b0dd3395ce0255708f9.zip
Patch from Vladimir N. Oleynik to simplify how it decides which
app was invoked. This removes several strcmp calls.
-rw-r--r--chmod_chown_chgrp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/chmod_chown_chgrp.c b/chmod_chown_chgrp.c
index cccda98be..178138a3b 100644
--- a/chmod_chown_chgrp.c
+++ b/chmod_chown_chgrp.c
@@ -83,9 +83,9 @@ int chmod_chown_chgrp_main(int argc, char **argv)
83 char *p=NULL; 83 char *p=NULL;
84 const char *appUsage; 84 const char *appUsage;
85 85
86 whichApp = (strcmp(applet_name, "chown") == 0)? 86 whichApp = (applet_name[2]=='o')? /* chown */
87 CHOWN_APP : (strcmp(applet_name, "chmod") == 0)? 87 CHOWN_APP : (applet_name[2]=='m')? /* chmod */
88 CHMOD_APP : CHGRP_APP; 88 CHMOD_APP : CHGRP_APP;
89 89
90 appUsage = (whichApp == CHOWN_APP)? 90 appUsage = (whichApp == CHOWN_APP)?
91 chown_usage : (whichApp == CHMOD_APP) ? chmod_usage : chgrp_usage; 91 chown_usage : (whichApp == CHMOD_APP) ? chmod_usage : chgrp_usage;