From: norbert.bizet Date: Tue, 15 Nov 2022 09:43:11 +0000 (-0500) Subject: fix bsys path split X-Git-Tag: Beta-15.0.0~364 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=427d2cac9534868c5e9ca67c0bcde97c6cb20b1f;p=thirdparty%2Fbacula.git fix bsys path split --- diff --git a/bacula/src/lib/bsys.c b/bacula/src/lib/bsys.c index b151c1555..0b1c879d8 100644 --- a/bacula/src/lib/bsys.c +++ b/bacula/src/lib/bsys.c @@ -2045,7 +2045,11 @@ void get_path_and_fname(const char *name, char **path, char **fname) /* separate exepath from exename */ *l = 0; *path = bstrdup(cargv0); +#if defined(HAVE_WIN32) + if (strstr(*path, PathSeparatorUp) != NULL || strstr(*fname, PathSeparatorCur) != NULL) { +#else if (strstr(*path, PathSeparatorUp) != NULL || strstr(*fname, PathSeparatorCur) != NULL || !IsPathSeparator(*path[0])) { +#endif /* fallback to legacy code */ if (getcwd(cpath, path_max)) { free(*path);