mmitch / gbsplay

gameboy sound player
https://mmitch.github.io/gbsplay/
Other
98 stars 20 forks source link

remove path from myname #32

Closed mmitch closed 3 years ago

mmitch commented 4 years ago

parseopts() in gbsplay.c sets myname = *argv[0]; and uses the variable later for the binary name in the help text shown by usage(). In the xgbsplay branch, myname will also be used for the version() output (-V parameter).

If you run gbsplay from your local build directory, myname will contain the directory and print it. This does not look very good:

$ ./gbsplay -V
./gbsplay 0.0.94-18-gfece946

$ $ ./gbsplay -h
Usage: ./gbsplay [option(s)] <gbs-file> [start_at_subsong [stop_at_subsong] ]

Available options are:
[…]

Use something like basedir() to remove the path from myname or just advance the pointer behind the last slash in argv[0] so no additional target buffer is needed.

mmitch commented 4 years ago

Should be fixed in commit dfa1218c6f1db44da7eab7b4a0e2bea0c2c728f0 but the xgbsplay branch is not yet merged to master (see issue #22).

mmitch commented 3 years ago

Because of a rebase the commit in question has changed to 9b1a56e5736f96260f63ab85f5eb5b99d50bc79c. The xgbsplay branch has been merged to master and so this issue is fixed.