* completer.c (complete_line_internal): Make sure the command
authorJoel Brobecker <brobecker@gnat.com>
Thu, 19 Nov 2009 22:44:34 +0000 (22:44 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Thu, 19 Nov 2009 22:44:34 +0000 (22:44 +0000)
        completer is not NULL before calling it.

gdb/ChangeLog
gdb/completer.c

index 4f89bc9d78aacadd7bc07f83b58e54e7aa7905bf..6ff3c3d572423a4bf5648310ff6f43f4f23acd17 100644 (file)
@@ -1,3 +1,8 @@
+2009-11-19  Joel Brobecker  <brobecker@adacore.com>
+
+       * completer.c (complete_line_internal): Make sure the command
+       completer is not NULL before calling it.
+
 2009-11-19  Jerome Guitton  <guitton@adacore.com>
 
        * ada-lang.c (packed_array_type): Rename to...
index 02e95110114d87c9fe475062189d5a736bee8314..b14edafbeef2b3b366b64de34450375ed98cd88c 100644 (file)
@@ -676,7 +676,7 @@ complete_line_internal (const char *text, char *line_buffer, int point,
                           p--)
                        ;
                    }
-                 if (reason != handle_brkchars)
+                 if (reason != handle_brkchars && c->completer != NULL)
                    list = (*c->completer) (c, p, word);
                }
            }
@@ -747,7 +747,7 @@ complete_line_internal (const char *text, char *line_buffer, int point,
                       p--)
                    ;
                }
-             if (reason != handle_brkchars)
+             if (reason != handle_brkchars && c->completer != NULL)
                list = (*c->completer) (c, p, word);
            }
        }