X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=common-src%2Ftoken.c;h=d894f40575b614c9f586cbb9bae58882a403f4c8;hb=1194fb66aa28d9929c3f2bef3cc6c1c3f40a60a4;hp=c56c9d199197f769853d5cd8e70d660ee7c9a802;hpb=3ab887b9bc819a846c75dd7f2ee5d41fac22b19f;p=debian%2Famanda diff --git a/common-src/token.c b/common-src/token.c index c56c9d1..d894f40 100644 --- a/common-src/token.c +++ b/common-src/token.c @@ -24,7 +24,7 @@ * file named AUTHORS, in the root directory of this distribution. */ /* - * $Id: token.c,v 1.22.8.3 2003/10/22 17:32:33 kovert Exp $ + * $Id: token.c,v 1.29 2006/01/14 04:37:19 paddy_s Exp $ * * token bashing routines */ @@ -141,7 +141,7 @@ printf_arglist_function(char *squotef, char *, format) /* Format the token */ arglist_start(argp, format); - ap_vsnprintf(linebuf, sizeof(linebuf), format, argp); + vsnprintf(linebuf, sizeof(linebuf), format, argp); arglist_end(argp); return quote(" ", linebuf); @@ -155,7 +155,7 @@ printf_arglist_function1(char *quotef, char *, sep, char *, format) /* Format the token */ arglist_start(argp, format); - ap_vsnprintf(linebuf, sizeof(linebuf), format, argp); + vsnprintf(linebuf, sizeof(linebuf), format, argp); arglist_end(argp); return quote(sep, linebuf); @@ -368,7 +368,7 @@ char *str; /* the string to quote */ return buf; } -#endif /* HAVE_SHQUOTE */ +#endif /* Table lookup. */ @@ -408,20 +408,14 @@ int main() int r; char *sr; int i; - int fd; - - for(fd = 3; fd < FD_SETSIZE; fd++) { - /* - * Make sure nobody spoofs us with a lot of extra open files - * that would cause an open we do to get a very high file - * descriptor, which in turn might be used as an index into - * an array (e.g. an fd_set). - */ - close(fd); - } + + safe_fd(-1, 0); set_pname("token test"); + /* Don't die when child closes pipe */ + signal(SIGPIPE, SIG_IGN); + erroutput_type = ERR_INTERACTIVE; printf("Testing split() with \" \" token separator\n");