diff options
| author | Phil Shafer <phil@FreeBSD.org> | 2019-11-07 18:05:26 +0000 |
|---|---|---|
| committer | Phil Shafer <phil@FreeBSD.org> | 2019-11-07 18:05:26 +0000 |
| commit | 5fe9672cf6a4e4e6c6bbdb133c9d998f577f88f2 (patch) | |
| tree | ce84af655647e03c5efa9ea2fb92f12e0aa3f803 /libxo | |
| parent | 0922e92a305ac1fd58f814909bbaf2f9fed56552 (diff) | |
Notes
Diffstat (limited to 'libxo')
| -rw-r--r-- | libxo/libxo.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libxo/libxo.c b/libxo/libxo.c index 09d2bd827f93..14268d1b250e 100644 --- a/libxo/libxo.c +++ b/libxo/libxo.c @@ -8104,12 +8104,14 @@ xo_parse_args (int argc, char **argv) cp = strrchr(xo_program, '/'); if (cp) xo_program = ++cp; + else + cp = argv[0]; /* Reset to front of string */ /* GNU tools add an annoying ".test" as the program extension; remove it */ size_t len = strlen(xo_program); static const char gnu_ext[] = ".test"; if (len >= sizeof(gnu_ext)) { - cp = &cp[len + 1 - sizeof(gnu_ext)]; + cp += len + 1 - sizeof(gnu_ext); if (xo_streq(cp, gnu_ext)) *cp = '\0'; } |
