X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=options.c;h=36291d1e27a64b4d24bd322aa518b4676fb68a67;hb=HEAD;hp=fa198891e54540d81c5c95c0c22f59a88be1972b;hpb=636335dbb356165e1d3e7cf91c416696d8b93910;p=debian%2Fpax diff --git a/options.c b/options.c index fa19889..36291d1 100644 --- a/options.c +++ b/options.c @@ -60,6 +60,8 @@ static const char rcsid[] = "$OpenBSD: options.c,v 1.70 2008/06/11 00:49:08 pval #include "tar.h" #include "extern.h" +#include "fgetln.h" /* added, David */ + /* * Routines which handle command line options */ @@ -72,7 +74,7 @@ static int no_op(void); static void printflg(unsigned int); static int c_frmt(const void *, const void *); static off_t str_offt(char *); -static char *getline(FILE *fp); +static char *bsd_getline(FILE *fp); static void pax_options(int, char **); static void pax_usage(void); static void tar_options(int, char **); @@ -882,7 +884,7 @@ tar_options(int argc, char **argv) paxwarn(1, "Unable to open file '%s' for read", file); tar_usage(); } - while ((str = getline(fp)) != NULL) { + while ((str = bsd_getline(fp)) != NULL) { if (pat_add(str, dir) < 0) tar_usage(); sawpat = 1; @@ -961,7 +963,7 @@ tar_options(int argc, char **argv) paxwarn(1, "Unable to open file '%s' for read", file); tar_usage(); } - while ((str = getline(fp)) != NULL) { + while ((str = bsd_getline(fp)) != NULL) { if (ftree_add(str, 0) < 0) tar_usage(); } @@ -1183,7 +1185,7 @@ cpio_options(int argc, char **argv) paxwarn(1, "Unable to open file '%s' for read", optarg); cpio_usage(); } - while ((str = getline(fp)) != NULL) { + while ((str = bsd_getline(fp)) != NULL) { pat_add(str, NULL); } fclose(fp); @@ -1282,7 +1284,7 @@ cpio_options(int argc, char **argv) * no read errors allowed on updates/append operation! */ maxflt = 0; - while ((str = getline(stdin)) != NULL) { + while ((str = bsd_getline(stdin)) != NULL) { ftree_add(str, 0); } if (getline_error) { @@ -1459,7 +1461,7 @@ str_offt(char *val) if ((num == LONG_MAX) || (num <= 0) || (expr == val)) # else num = strtoq(val, &expr, 0); - if ((num == QUAD_MAX) || (num <= 0) || (expr == val)) + if ((num == LLONG_MAX) || (num <= 0) || (expr == val)) # endif return(0); @@ -1511,7 +1513,7 @@ str_offt(char *val) } char * -getline(FILE *f) +bsd_getline(FILE *f) { char *name, *temp; size_t len;