From 6f35fce8699fb8cf4c2eba3b800f4db09e8407a6 Mon Sep 17 00:00:00 2001 From: "Andrew V. Samoilov" Date: Thu, 6 Mar 2003 18:42:33 +0000 Subject: [PATCH] * syntax.c (edit_read_syntax_file): Fix segmentation violation. --- edit/ChangeLog | 4 ++++ edit/syntax.c | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/edit/ChangeLog b/edit/ChangeLog index c4dec2ac6..b17e031ed 100644 --- a/edit/ChangeLog +++ b/edit/ChangeLog @@ -1,3 +1,7 @@ +2003-03-06 Andrew V. Samoilov + + * syntax.c (edit_read_syntax_file): Fix segmentation violation. + 2003-03-03 Andrew V. Samoilov * syntax.c (edit_read_syntax_rules): Check for list of defines diff --git a/edit/syntax.c b/edit/syntax.c index 2d53e1021..e5ac79936 100644 --- a/edit/syntax.c +++ b/edit/syntax.c @@ -1005,7 +1005,9 @@ edit_read_syntax_file (WEdit * edit, char **names, const char *syntax_file, } if (q) { int line_error; + char *syntax_type; found_type: + syntax_type = args[2]; line_error = edit_read_syntax_rules (edit, g ? g : f, args); if (line_error) { if (!error_file_name) /* an included file */ @@ -1014,7 +1016,7 @@ edit_read_syntax_file (WEdit * edit, char **names, const char *syntax_file, result = line_error; } else { syntax_g_free (edit->syntax_type); - edit->syntax_type = g_strdup (args[2]); + edit->syntax_type = g_strdup (syntax_type); /* if there are no rules then turn off syntax highlighting for speed */ if (!g && !edit->rules[1]) if (!edit->rules[0]->keyword[1] && !edit->rules[0]->spelling) {