]> git.eshelyaron.com Git - emacs.git/commitdiff
(entry_match_p, header_match_p): Fix handling of null or empty
authorGerd Moellmann <gerd@gnu.org>
Fri, 20 Jul 2001 10:02:06 +0000 (10:02 +0000)
committerGerd Moellmann <gerd@gnu.org>
Fri, 20 Jul 2001 10:02:06 +0000 (10:02 +0000)
argument to prevent duplicate headers.

lib-src/grep-changelog

index b264bdc23d679c6261919f0ef1b73cc5f01b168b..15a3d3c99d5a057407a68a0aa7233f9bada7469b 100755 (executable)
@@ -1,5 +1,5 @@
 #! /usr/bin/perl
-# $Id: grep-changelog,v 1.3 2000/06/14 07:09:42 meyering Exp $
+# $Id: grep-changelog,v 1.4 2001/07/20 09:59:19 gerd Exp $
 
 # Copyright (C) 1999, 2000, 2001 Free Software Foundation, Inc.
 #
@@ -89,6 +89,8 @@ if ($version) {
 sub header_match_p ($) {
     my $header = shift;
 
+    return 0 unless $header;
+
     # No match if AUTHOR-regexp specified and doesn't match.
     return 0 if $author && $header !~ /$author/;
 
@@ -117,6 +119,8 @@ sub header_match_p ($) {
 sub entry_match_p ($) {
     my $entry = shift;
 
+    return 0 unless $entry;
+
     if ($regexp) {
        return 1 if ($entry =~ /$regexp/
                     && (!$exclude || $entry !~ $exclude));