From 34fec86ca3a81a4d4490d144717b1e714d1fee07 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Thu, 21 Sep 2000 23:47:41 +0000 Subject: [PATCH] make next_token() shared. --- bin/dig/dig.c | 15 +-------------- bin/dig/dighost.c | 4 ++-- bin/dig/include/dig/dig.h | 5 ++++- bin/dig/nslookup.c | 13 +------------ 4 files changed, 8 insertions(+), 29 deletions(-) diff --git a/bin/dig/dig.c b/bin/dig/dig.c index 0a0eae5a2a..fd3440a4de 100644 --- a/bin/dig/dig.c +++ b/bin/dig/dig.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dig.c,v 1.96 2000/09/21 23:02:30 mws Exp $ */ +/* $Id: dig.c,v 1.97 2000/09/21 23:47:36 marka Exp $ */ #include #include @@ -128,19 +128,6 @@ static const char *rcodetext[] = { extern char *progname; -static char * -next_token(char **stringp, const char *delim) { - char *res; - - do { - res = strsep(stringp, delim); - if (res == NULL) - break; - } while (*res == '\0'); - return (res); -} - - static void show_usage(void) { fputs( diff --git a/bin/dig/dighost.c b/bin/dig/dighost.c index 8815582d33..273a3cd028 100644 --- a/bin/dig/dighost.c +++ b/bin/dig/dighost.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dighost.c,v 1.131 2000/09/21 23:02:32 mws Exp $ */ +/* $Id: dighost.c,v 1.132 2000/09/21 23:47:38 marka Exp $ */ /* * Notice to programmers: Do not use this code as an example of how to @@ -145,7 +145,7 @@ recv_done(isc_task_t *task, isc_event_t *event); static void connect_timeout(isc_task_t *task, isc_event_t *event); -static char * +char * next_token(char **stringp, const char *delim) { char *res; diff --git a/bin/dig/include/dig/dig.h b/bin/dig/include/dig/dig.h index b139c43e7c..a011ecb9d7 100644 --- a/bin/dig/include/dig/dig.h +++ b/bin/dig/include/dig/dig.h @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: dig.h,v 1.47 2000/09/21 23:02:34 mws Exp $ */ +/* $Id: dig.h,v 1.48 2000/09/21 23:47:41 marka Exp $ */ #ifndef DIG_H #define DIG_H @@ -237,6 +237,9 @@ trying(int frmsize, char *frm, dig_lookup_t *lookup); void dighost_shutdown(void); +char * +next_token(char **stringp, const char *delim); + ISC_LANG_ENDDECLS #endif diff --git a/bin/dig/nslookup.c b/bin/dig/nslookup.c index c53b46fd7c..445dd1f39f 100644 --- a/bin/dig/nslookup.c +++ b/bin/dig/nslookup.c @@ -15,7 +15,7 @@ * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -/* $Id: nslookup.c,v 1.52 2000/09/21 23:10:58 gson Exp $ */ +/* $Id: nslookup.c,v 1.53 2000/09/21 23:47:40 marka Exp $ */ #include @@ -148,17 +148,6 @@ static const char *rtypetext[] = { static void flush_lookup_list(void); static void getinput(isc_task_t *task, isc_event_t *event); -static char * -next_token(char **stringp, const char *delim) { - char *res; - do { - res = strsep(stringp, delim); - if (res == NULL) - break; - } while (*res == '\0'); - return (res); -} - static void show_usage(void) { fputs("Usage:\n", stderr);