diff options
author | Guy Harris <gharris@sonic.net> | 2020-06-11 21:01:31 -0700 |
---|---|---|
committer | Guy Harris <gharris@sonic.net> | 2020-06-11 21:01:31 -0700 |
commit | 27ede6609cad295a3100fe7c11fca35192da8d74 (patch) | |
tree | 75e1b5e88bae6934c87b76f2ccc67051e9a93bf1 /tcpdump.c | |
parent | de60de43d0373da5134dbab4e081fb630e8f1298 (diff) | |
download | tcpdump-27ede6609cad295a3100fe7c11fca35192da8d74.tar.gz |
Use \ rather than / as a pathname separator in Windows.
Diffstat (limited to 'tcpdump.c')
-rw-r--r-- | tcpdump.c | 12 |
1 files changed, 11 insertions, 1 deletions
@@ -124,6 +124,16 @@ The Regents of the University of California. All rights reserved.\n"; #include <grp.h> #endif /* _WIN32 */ +/* + * Pathname separator. + * Use this in pathnames, but do *not* use it in URLs. + */ +#ifdef _WIN32 +#define PATH_SEPARATOR '\\' +#else +#define PATH_SEPARATOR '/' +#endif + /* capabilities convenience library */ /* If a code depends on HAVE_LIBCAP_NG, it depends also on HAVE_CAP_NG_H. * If HAVE_CAP_NG_H is not defined, undefine HAVE_LIBCAP_NG. @@ -1498,7 +1508,7 @@ main(int argc, char **argv) VFile = NULL; WFileName = NULL; dlt = -1; - if ((cp = strrchr(argv[0], '/')) != NULL) + if ((cp = strrchr(argv[0], PATH_SEPARATOR)) != NULL) ndo->program_name = program_name = cp + 1; else ndo->program_name = program_name = argv[0]; |