Take into account the fact that "[" may be called with a path,
for example "/bin/[". Reported by: Vlad Skvortsov <vss@ulstu.ru> Reported by: Peter Jeremy <peter.jeremy@alcatel.com.au> Message-Id: 99Dec27.111307est.40321@border.alcanet.com.au
This commit is contained in:
parent
920eb79f55
commit
9abf30435b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=55179
@ -163,8 +163,13 @@ main(argc, argv)
|
||||
char **argv;
|
||||
{
|
||||
int res;
|
||||
char *p;
|
||||
|
||||
if (strcmp(argv[0], "[") == 0) {
|
||||
if ((p = rindex(argv[0], '/')) == NULL)
|
||||
p = argv[0];
|
||||
else
|
||||
p++;
|
||||
if (strcmp(p, "[") == 0) {
|
||||
if (strcmp(argv[--argc], "]"))
|
||||
errx(2, "missing ]");
|
||||
argv[argc] = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user