mingw: let the build succeed with DEVELOPER=1
[gitweb.git] / exec_cmd.c
index cf442a97f86aea7accc673d3fe55b9b7494dbf78..9d5703a157fe8e9d8396e0771798e54dc5eea6eb 100644 (file)
@@ -44,12 +44,10 @@ const char *git_extract_argv0_path(const char *argv0)
 
        if (!argv0 || !*argv0)
                return NULL;
-       slash = argv0 + strlen(argv0);
 
-       while (argv0 <= slash && !is_dir_sep(*slash))
-               slash--;
+       slash = find_last_dir_sep(argv0);
 
-       if (slash >= argv0) {
+       if (slash) {
                argv0_path = xstrndup(argv0, slash - argv0);
                return slash + 1;
        }