[geany/geany-plugins] 65f544: Automark: Fix a segfault in case of nothing is selected for auto-marking

Frank Lanitz git-noreply at xxxxx
Sun Dec 11 13:24:52 UTC 2016


Branch:      refs/heads/master
Author:      Frank Lanitz <frank at frank.uvena.de>
Committer:   Frank Lanitz <frank at frank.uvena.de>
Date:        Sun, 11 Dec 2016 13:24:52 UTC
Commit:      65f54463472a780115fbb1ad1a01bce5a0aa4a23
             https://github.com/geany/geany-plugins/commit/65f54463472a780115fbb1ad1a01bce5a0aa4a23

Log Message:
-----------
Automark: Fix a segfault in case of nothing is selected for auto-marking


Modified Paths:
--------------
    automark/src/automark.c

Modified: automark/src/automark.c
6 lines changed, 3 insertions(+), 3 deletions(-)
===================================================================
@@ -86,7 +86,7 @@ get_current_word(ScintillaObject *sci)
 	gint pos = sci_get_current_position(sci);
 	gint start = SSM(sci, SCI_WORDSTARTPOSITION, pos, TRUE);
 	gint end = SSM(sci, SCI_WORDENDPOSITION, pos, TRUE);
-	
+
 	if ((guint)(end - start) >= GEANY_MAX_WORD_LENGTH)
 		end = start + (GEANY_MAX_WORD_LENGTH - 1);
 	return sci_get_contents_range(sci, start, end);
@@ -116,7 +116,7 @@ automark(gpointer user_data)
 
 	text = get_current_word(editor->sci);
 
-	if (!*text)
+	if (EMPTY(text))
 	{
 		editor_indicator_clear(editor, AUTOMARK_INDICATOR);
 		g_free(text);
@@ -129,7 +129,7 @@ automark(gpointer user_data)
 		strcpy(text_cache, text);
 		editor_cache = editor;
 	}
-	
+
 	gint vis_first = SSM(sci, SCI_GETFIRSTVISIBLELINE, 0, 0);
 	gint doc_first = SSM(sci, SCI_DOCLINEFROMVISIBLE, vis_first, 0);
 	gint vis_last  = SSM(sci, SCI_LINESONSCREEN, 0, 0) + vis_first;



--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).


More information about the Plugins-Commits mailing list