From 8775cf804ec369820e4afba5230fe9cb122eac0d Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Wed, 3 May 2023 11:55:24 +0200 Subject: [PATCH] Fix compilation on Windows after f30434ac99. --- source/blender/blenlib/intern/path_util.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 9b24399f1be..59f20c45119 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -1137,7 +1137,7 @@ bool BLI_path_abs_from_cwd(char *path, const size_t maxlen) #ifdef _WIN32 /** * Tries appending each of the semicolon-separated extensions in the `PATHEXT` - * environment variable (Windows-only) onto `name` in turn until such a file is found. + * environment variable (Windows-only) onto `program_name` in turn until such a file is found. * Returns success/failure. */ bool BLI_path_program_extensions_add_win32(char *program_name, const size_t maxlen) @@ -1145,19 +1145,19 @@ bool BLI_path_program_extensions_add_win32(char *program_name, const size_t maxl bool retval = false; int type; - type = BLI_exists(name); + type = BLI_exists(program_name); if ((type == 0) || S_ISDIR(type)) { /* Typically 3-5, ".EXE", ".BAT"... etc. */ const int ext_max = 12; const char *ext = BLI_getenv("PATHEXT"); if (ext) { - const int name_len = strlen(name); + const int name_len = strlen(program_name); char *filename = alloca(name_len + ext_max); char *filename_ext; const char *ext_next; /* Null terminated in the loop. */ - memcpy(filename, name, name_len); + memcpy(filename, program_name, name_len); filename_ext = filename + name_len; do { @@ -1172,7 +1172,7 @@ bool BLI_path_program_extensions_add_win32(char *program_name, const size_t maxl type = BLI_exists(filename); if (type && (!S_ISDIR(type))) { retval = true; - BLI_strncpy(name, filename, maxlen); + BLI_strncpy(program_name, filename, maxlen); break; } }