Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/lib/libedit/readline.c,v rcsdiff: /ftp/cvs/cvsroot/src/lib/libedit/readline.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.26 retrieving revision 1.28 diff -u -p -r1.26 -r1.28 --- src/lib/libedit/readline.c 2003/01/21 17:41:38 1.26 +++ src/lib/libedit/readline.c 2003/03/10 01:14:54 1.28 @@ -1,4 +1,4 @@ -/* $NetBSD: readline.c,v 1.26 2003/01/21 17:41:38 christos Exp $ */ +/* $NetBSD: readline.c,v 1.28 2003/03/10 01:14:54 christos Exp $ */ /*- * Copyright (c) 1997 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ #include "config.h" #if !defined(lint) && !defined(SCCSID) -__RCSID("$NetBSD: readline.c,v 1.26 2003/01/21 17:41:38 christos Exp $"); +__RCSID("$NetBSD: readline.c,v 1.28 2003/03/10 01:14:54 christos Exp $"); #endif /* not lint && not SCCSID */ #include @@ -51,6 +51,9 @@ __RCSID("$NetBSD: readline.c,v 1.26 2003 #include #include #include +#ifdef HAVE_ALLOCA_H +#include +#endif #include "histedit.h" #include "readline/readline.h" #include "el.h" @@ -523,7 +526,7 @@ _history_expand_command(const char *comm line = strdup(event_data); if (line == NULL) - return NULL; + return 0; for (; *cmd; cmd++) { if (*cmd == ':') continue; @@ -552,7 +555,7 @@ _history_expand_command(const char *comm what = realloc(from, size); if (what == NULL) { free(from); - return NULL; + return 0; } len = 0; for (; *cmd && *cmd != delim; cmd++) { @@ -565,7 +568,7 @@ _history_expand_command(const char *comm (size <<= 1)); if (nwhat == NULL) { free(what); - return NULL; + return 0; } what = nwhat; } @@ -578,7 +581,7 @@ _history_expand_command(const char *comm if (search) { from = strdup(search); if (from == NULL) - return NULL; + return 0; } else { from = NULL; return (-1); @@ -674,7 +677,7 @@ _history_expand_command(const char *comm cmdsize = 1, cmdlen = 0; if ((tempcmd = malloc(cmdsize)) == NULL) - return NULL; + return 0; for (i = start; start <= i && i <= end; i++) { int arr_len; @@ -685,7 +688,7 @@ _history_expand_command(const char *comm ntempcmd = realloc(tempcmd, cmdsize); if (ntempcmd == NULL) { free(tempcmd); - return NULL; + return 0; } tempcmd = ntempcmd; } @@ -721,7 +724,7 @@ history_expand(char *str, char **output) *output = strdup(str); /* do it early */ if (*output == NULL) - return NULL; + return 0; if (str[0] == history_subst_char) { /* ^foo^foo2^ is equivalent to !!:s^foo^foo2^ */ @@ -738,7 +741,7 @@ history_expand(char *str, char **output) char *nresult = realloc(result, (size += len + 1));\ if (nresult == NULL) { \ free(*output); \ - return NULL; \ + return 0; \ } \ result = nresult; \ } \