1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-21 14:57:09 +00:00
Files
godot/platform/x11/os_x11.cpp
Omar Polo 04c08d1f8c use .get_file() instead of basename(3)
On OpenBSD the compiler complains that calling basename(3) would lose
const qualifier.  basename(3) is defined as

	char *basename(char *);

and can, accorgindly to the POSIX.1, modify the passed string.

This uses the .get_file() method.  The check is necessary because
file_name could be a directory, in which case .get_file() would return
an empty string.  The .get_base_dir().get_file() idiom is already used.

The usage of get_file() and the check were suggested by theraot, thanks!

(cherry picked from commit a3384b7461)
2021-10-10 12:27:51 +02:00

116 KiB