mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #3384 from equalsraf/tb-vla
Remove VLA from path_get_absolute_path
This commit is contained in:
commit
641c6420e1
@ -121,7 +121,7 @@ if(MSVC)
|
|||||||
add_definitions(/W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
add_definitions(/W3 -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
else()
|
else()
|
||||||
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
|
add_definitions(-Wall -Wextra -pedantic -Wno-unused-parameter
|
||||||
-Wstrict-prototypes -std=gnu99)
|
-Wstrict-prototypes -Wvla -std=gnu99)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(MINGW)
|
if(MINGW)
|
||||||
|
@ -2083,7 +2083,7 @@ static int path_get_absolute_path(const char_u *fname, char_u *buf, int len, int
|
|||||||
char_u *p;
|
char_u *p;
|
||||||
*buf = NUL;
|
*buf = NUL;
|
||||||
|
|
||||||
char relative_directory[len];
|
char *relative_directory = xmalloc(len);
|
||||||
char *end_of_path = (char *) fname;
|
char *end_of_path = (char *) fname;
|
||||||
|
|
||||||
// expand it if forced or not an absolute path
|
// expand it if forced or not an absolute path
|
||||||
@ -2105,9 +2105,11 @@ static int path_get_absolute_path(const char_u *fname, char_u *buf, int len, int
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (FAIL == path_full_dir_name(relative_directory, (char *) buf, len)) {
|
if (FAIL == path_full_dir_name(relative_directory, (char *) buf, len)) {
|
||||||
|
xfree(relative_directory);
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
xfree(relative_directory);
|
||||||
return append_path((char *)buf, end_of_path, len);
|
return append_path((char *)buf, end_of_path, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user