Annotation of pkgsrc/graphics/gnuplot/patches/patch-src_command.c, revision 1.1

1.1     ! he          1: $NetBSD$
        !             2: 
        !             3: Avoid de-referencing a NULL pointer on the first command executed(!)
        !             4: 
        !             5: --- src/command.c.orig 2012-02-27 21:58:36.000000000 +0000
        !             6: +++ src/command.c
        !             7: @@ -2689,7 +2689,8 @@ rlgets(char *s, size_t n, const char *pr
        !             8:            /* deleting history entries does not work, so suppress adjacent 
        !             9:            duplicates only */
        !            10:            while (previous_history());
        !            11: -          if (strcmp(current_history()->line, line) != 0)
        !            12: +          if (current_history() != NULL &&
        !            13: +              strcmp(current_history()->line, line) != 0)
        !            14:                add_history(line);
        !            15:  #  else /* builtin readline */
        !            16:            add_history(line);

CVSweb <webmaster@jp.NetBSD.org>