aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/test/test.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bin/test/test.c b/bin/test/test.c
index e02559d3df72..c9df4e3cb758 100644
--- a/bin/test/test.c
+++ b/bin/test/test.c
@@ -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;