Skip to content

Commit

Permalink
exename() was not const
Browse files Browse the repository at this point in the history
  • Loading branch information
xparq committed Dec 1, 2023
1 parent 188dec8 commit 192575c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Args.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
#include <cassert>
//#include <iostream> // cerr, for debugging

class Args // Tiny cmdline processor 1.2.0 (-> github.com/xparq/Args)
class Args // Tiny cmdline processor 1.2.1 (-> github.com/xparq/Args)
{
public:
enum { Defaults = 0, // Invalid combinations are not checked!
Expand Down Expand Up @@ -70,7 +70,7 @@ class Args // Tiny cmdline processor 1.2.0 (-> github.com/xparq/Args)

// Remember: this is coming from the command that eventually launched the exe, so it
// could be "anything"... E.g. no guarantee that it ends with ".exe" on Windows etc.
std::string exename(bool keep_as_is = false, std::string ext = ".exe") {
std::string exename(bool keep_as_is = false, std::string ext = ".exe") const {
// Anyway, if it has a path, remove it:
std::string basename(std::string(argv[0]).substr(std::string(argv[0]).find_last_of("/\\") + 1));
if (keep_as_is) { return basename; }
Expand Down

0 comments on commit 192575c

Please sign in to comment.