Merge pull request #2095 from profanity-im/morefixes
Add more compiler flags
This commit is contained in:
@@ -39,7 +39,7 @@ tests=(
|
||||
if [[ "$(uname | tr '[:upper:]' '[:lower:]')" == linux* ]]; then
|
||||
echo "--> Running Valgrind check with full features"
|
||||
|
||||
meson setup build_valgrind ${tests[0]} -Dtests=true
|
||||
meson setup build_valgrind ${tests[0]} -Dtests=true -Db_sanitize=address,undefined
|
||||
meson compile -C build_valgrind
|
||||
|
||||
meson test -C build_valgrind --print-errorlogs --wrap=valgrind || echo "Valgrind issues detected"
|
||||
|
||||
@@ -67,7 +67,8 @@ if is_debug
|
||||
'-Wextra',
|
||||
'-fstack-protector-strong',
|
||||
'-D_FORTIFY_SOURCE=2',
|
||||
'-Og'
|
||||
'-Og',
|
||||
'-Wpointer-arith'
|
||||
], language: 'c')
|
||||
if cc.get_id() == 'gcc'
|
||||
add_project_arguments('-fanalyzer', language: 'c')
|
||||
|
||||
@@ -1545,6 +1545,10 @@ cmd_ac_remove_form_fields(DataForm* form)
|
||||
char*
|
||||
cmd_ac_complete(ProfWin* window, const char* const input, gboolean previous)
|
||||
{
|
||||
if (!input) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char* found = NULL;
|
||||
// autocomplete command
|
||||
if ((strncmp(input, "/", 1) == 0) && (!strchr(input, ' '))) {
|
||||
|
||||
@@ -86,12 +86,18 @@ get_message_from_editor(gchar* message, gchar** returned_message)
|
||||
auto_gchar gchar* editor_with_filename = g_strdup_printf("%s %s", editor, filename);
|
||||
auto_gcharv gchar** editor_argv = g_strsplit(editor_with_filename, " ", 0);
|
||||
|
||||
if (!editor_argv || !editor_argv[0]) {
|
||||
log_error("[Editor] Failed to parse editor command: %s", editor);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Fork / exec
|
||||
pid_t pid = fork();
|
||||
if (pid == 0) {
|
||||
int x = execvp(editor_argv[0], editor_argv);
|
||||
if (x == -1) {
|
||||
log_error("[Editor] Failed to exec %s", editor);
|
||||
if (editor_argv && editor_argv[0]) {
|
||||
int x = execvp(editor_argv[0], editor_argv);
|
||||
if (x == -1)
|
||||
log_error("[Editor] Failed to exec %s", editor);
|
||||
}
|
||||
_exit(EXIT_FAILURE);
|
||||
} else {
|
||||
|
||||
@@ -477,16 +477,13 @@ form_set_value(DataForm* form, const char* const tag, char* value)
|
||||
while (curr) {
|
||||
FormField* field = curr->data;
|
||||
if (g_strcmp0(field->var, var) == 0) {
|
||||
if (g_slist_length(field->values) == 0) {
|
||||
field->values = g_slist_append(field->values, strdup(value));
|
||||
form->modified = TRUE;
|
||||
return;
|
||||
} else if (g_slist_length(field->values) == 1) {
|
||||
free(field->values->data);
|
||||
field->values->data = strdup(value);
|
||||
form->modified = TRUE;
|
||||
return;
|
||||
if (field->values) {
|
||||
g_slist_free_full(field->values, free);
|
||||
field->values = NULL;
|
||||
}
|
||||
field->values = g_slist_append(NULL, strdup(value));
|
||||
form->modified = TRUE;
|
||||
return;
|
||||
}
|
||||
curr = g_slist_next(curr);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user