diff --git a/Mac/Tools/pythonw.c b/Mac/Tools/pythonw.c index 1d2db38..cf81241 100644 --- a/Mac/Tools/pythonw.c +++ b/Mac/Tools/pythonw.c @@ -163,24 +163,11 @@ main(int argc, char **argv) { * Note: don't call 'realpath', that will * erase symlink information, and that * breaks "pyvenv --symlink" - * - * It is nice to have the directory name - * as a cleaned up absolute path though, - * therefore call realpath on dirname(path) */ char* slash = strrchr(path, '/'); if (slash) { - char replaced; - replaced = slash[1]; - slash[1] = 0; - if (realpath(path, real_path) == NULL) { - err(1, "realpath: %s", path); - } - slash[1] = replaced; - if (strlcat(real_path, slash, sizeof(real_path)) > sizeof(real_path)) { - errno = EINVAL; - err(1, "realpath: %s", path); - } + strncpy(real_path, path, sizeof(real_path)); + real_path[sizeof(real_path)-1] = 0; } else { if (realpath(".", real_path) == NULL) {