diff options
author | Ron Yorston <rmy@pobox.com> | 2019-02-07 09:34:55 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2019-02-07 09:34:55 +0000 |
commit | c9b1e40ba52bd1f167189f52563a47c85df9881f (patch) | |
tree | 16517b05902386e839a002fd582abed4e0632057 | |
parent | dbb51f0845f904d56da09cf37537ef748b7c169e (diff) | |
download | busybox-w32-c9b1e40ba52bd1f167189f52563a47c85df9881f.tar.gz busybox-w32-c9b1e40ba52bd1f167189f52563a47c85df9881f.tar.bz2 busybox-w32-c9b1e40ba52bd1f167189f52563a47c85df9881f.zip |
libbb: skip fake path components
Commit 3476fb9f4 added a fake prefix to the applet pathname to
identify the argument containing the name of an interpreted
script.
Skip over the prefix to prevent it appearing in error messages.
-rw-r--r-- | libbb/appletlib.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/libbb/appletlib.c b/libbb/appletlib.c index 921883475..be243de79 100644 --- a/libbb/appletlib.c +++ b/libbb/appletlib.c | |||
@@ -1213,11 +1213,12 @@ int main(int argc UNUSED_PARAM, char **argv) | |||
1213 | /* detect if we're running an interpreted script */ | 1213 | /* detect if we're running an interpreted script */ |
1214 | if (argv[0][1] == ':' && argv[0][2] == '/') { | 1214 | if (argv[0][1] == ':' && argv[0][2] == '/') { |
1215 | switch (argv[0][0]) { | 1215 | switch (argv[0][0]) { |
1216 | case '2': | ||
1217 | ++interp; | ||
1218 | /* fall through */ | ||
1216 | case '1': | 1219 | case '1': |
1217 | interp = 1; | 1220 | ++interp; |
1218 | break; | 1221 | argv[0] += 3; |
1219 | case'2': | ||
1220 | interp = 2; | ||
1221 | break; | 1222 | break; |
1222 | } | 1223 | } |
1223 | } | 1224 | } |