Skip to content

Commit f53d7c9

Browse files
authored
Merge pull request #127 from pps83/icappexename
Extract program name without full path in icapp
2 parents 20b9713 + b3344e2 commit f53d7c9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

lib/icapp.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2069,8 +2069,10 @@ static const char zDefault[] = "memcpy";
20692069
#endif
20702070

20712071
void usage(char *pgm) {
2072-
char lzs[256];
2073-
fprintf(stderr, "\nIcApp Copyright (c) 2013-2023 Powturbo %s\n", __DATE__);
2072+
for (char* p = pgm; *p; ++p) // extract program name without full path
2073+
if (*p == '\\' || *p == '/')
2074+
pgm = p + 1;
2075+
fprintf(stderr, "IcApp Copyright (c) 2013-2024 Powturbo, %s\n", __DATE__);
20742076
fprintf(stderr, "Usage: %s [options] [file]\n", pgm);
20752077
//fprintf(stderr, " -b#s # = blocksize (default filesize,). max=1GB\n");
20762078
fprintf(stderr, " -B#s # = max. benchmark filesize (default 1GB) ex. -B4G\n");

0 commit comments

Comments
 (0)