citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

commit 9b708bdfc8b4d9177ce6388689a2277da198ae5e
parent b7bd207e31d563406247c939e3a29c32500f15ee
Author: Kyle Milz <kyle@getaddrinfo.net>
Date:   Fri, 18 Mar 2016 02:05:24 -0600

instrument: looks like openbsd is the {bir,base}name exception

Diffstat:
Minstrument/main.cxx | 14++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/instrument/main.cxx b/instrument/main.cxx @@ -121,19 +121,17 @@ main(int argc, char *argv[]) source_files.push_back(arg); // Find original directory or "." if relative path -#ifdef __APPLE__ - // Apple's man page says it modifies the argument - // pointer and the argument signature loses 'const' - char *src_dir = dirname(strdup(arg.c_str())); -#else +#ifdef __OPENBSD__ char *src_dir = dirname(arg.c_str()); +#else + char *src_dir = dirname(strdup(arg.c_str())); #endif if (src_dir == NULL) err(1, "dirname"); -#ifdef __APPLE__ - char *src_name = basename(strdup(arg.c_str())); -#else +#ifdef __OPENBSD__ char *src_name = basename(arg.c_str()); +#else + char *src_name = basename(strdup(arg.c_str())); #endif if (src_name == NULL) err(1, "basename");