Define POSIX macro to have strdup

98c38dc6d6
sets C99 as standard.

strdup() is not part of C99.

For now set `-D_POSIX_C_SOURCE=200809L` macro to have strdup() in C99.
Using `gnu99` instead would be another option.

We should take more care to use glib functions whenever possible.

Regards https://github.com/profanity-im/profanity/issues/1357
This commit is contained in:
Michael Vetter
2020-06-12 16:12:21 +02:00
parent f1141932fc
commit 74e061165a
8 changed files with 28 additions and 25 deletions

View File

@@ -503,10 +503,10 @@ _inp_rl_startup_hook(void)
rl_variable_bind("disable-completion", "on");
// check for and load ~/.config/profanity/inputrc
char *inputrc = files_get_inputrc_file();
gchar *inputrc = files_get_inputrc_file();
if (inputrc) {
rl_read_init_file(inputrc);
free(inputrc);
g_free(inputrc);
}
return 0;