diff options
author | Omar Polo <op@omarpolo.com> | 2021-08-09 09:39:20 +0000 |
---|---|---|
committer | Omar Polo <op@omarpolo.com> | 2021-10-08 20:10:26 +0200 |
commit | a3384b7461005260d0dd5c8f05df28ee842442de (patch) | |
tree | 9e5bbd41c081a10743ad454f1294da6f4c3043d4 /scene/main/canvas_item.h | |
parent | 0cbb19a246b2a701dde848d86bff319b571efad7 (diff) |
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!
Diffstat (limited to 'scene/main/canvas_item.h')
0 files changed, 0 insertions, 0 deletions