]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/parse_entry.c
ncurses 5.7 - patch 20100501
[ncurses.git] / ncurses / tinfo / parse_entry.c
index 6e59775b7bd70831fc54271e8d89670402127057..ddbc25204fec882b0bde07bc38c6181d6d3b540a 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -46,9 +46,8 @@
 
 #include <ctype.h>
 #include <tic.h>
-#include <term_entry.h>
 
-MODULE_ID("$Id: parse_entry.c,v 1.71 2009/07/11 18:14:21 tom Exp $")
+MODULE_ID("$Id: parse_entry.c,v 1.75 2010/05/01 19:35:09 tom Exp $")
 
 #ifdef LINT
 static short const parametrized[] =
@@ -512,9 +511,9 @@ NCURSES_EXPORT(int)
 _nc_capcmp(const char *s, const char *t)
 /* compare two string capabilities, stripping out padding */
 {
-    if (!s && !t)
+    if (!VALID_STRING(s) && !VALID_STRING(t))
        return (0);
-    else if (!s || !t)
+    else if (!VALID_STRING(s) || !VALID_STRING(t))
        return (1);
 
     for (;;) {
@@ -669,7 +668,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base)
            else if (PRESENT(backspace_if_not_bs))
                cursor_left = backspace_if_not_bs;
        }
-       /* vi doesn't use "do", but it does seems to use nl (or '\n') instead */
+       /* vi doesn't use "do", but it does seem to use nl (or '\n') instead */
        if (WANTED(cursor_down)) {
            if (PRESENT(linefeed_if_not_lf))
                cursor_down = linefeed_if_not_lf;
@@ -774,7 +773,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base)
      * isn't from mytinfo...
      */
     if (PRESENT(other_non_function_keys)) {
-       char *base = other_non_function_keys;
+       char *base;
        char *bp, *cp, *dp;
        struct name_table_entry const *from_ptr;
        struct name_table_entry const *to_ptr;
@@ -842,7 +841,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base)
                } else
                    *dp++ = *bp;
            }
-           *dp++ = '\0';
+           *dp = '\0';
 
            tp->Strings[to_ptr->nte_index] = _nc_save_str(buf2);
        }