[gnome-builder] git: don't walk past text length



commit 5c7f77281ab8fde6a6d567c232b0d51dabd44e2a
Author: Christian Hergert <chergert redhat com>
Date:   Thu Oct 13 18:01:14 2016 -0700

    git: don't walk past text length
    
    Ensure we only walk as many characters as specified by length.

 plugins/git/ide-git-buffer-change-monitor.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/plugins/git/ide-git-buffer-change-monitor.c b/plugins/git/ide-git-buffer-change-monitor.c
index 51fc896..991291d 100644
--- a/plugins/git/ide-git-buffer-change-monitor.c
+++ b/plugins/git/ide-git-buffer-change-monitor.c
@@ -352,7 +352,7 @@ ide_git_buffer_change_monitor__buffer_insert_text_after_cb (IdeGitBufferChangeMo
    * more conservative timeout, generated by ide_git_buffer_change_monitor__buffer_changed_cb().
    */
 
-  if (strchr (text, '\n') != NULL)
+  if (NULL != memmem (text, len, "\n", 1))
     goto recalculate;
 
   change = ide_git_buffer_change_monitor_get_change (IDE_BUFFER_CHANGE_MONITOR (self), location);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]