From 32087595f702848519db3c9c8c77716e78f95aca Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Tue, 5 Feb 2002 11:58:03 +0000 Subject: [w3m-dev 02990] * file.c (doFileCopy): use Strfgets() instead of fgets() * file.c (doFileSave): ditto From: Fumitoshi UKAI --- ChangeLog | 8 +++++++- file.c | 18 +++++++++--------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index ebb0ae8..1b1ee17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2002-02-05 Fumitoshi UKAI + + * [w3m-dev 02990] + * file.c (doFileCopy): use Strfgets() instead of fgets() + * file.c (doFileSave): ditto + 2002-02-05 Fumitoshi UKAI * [w3m-dev 02989] @@ -2799,4 +2805,4 @@ * release-0-2-1 * import w3m-0.2.1 -$Id: ChangeLog,v 1.300 2002/02/05 03:45:33 ukai Exp $ +$Id: ChangeLog,v 1.301 2002/02/05 11:58:03 ukai Exp $ diff --git a/file.c b/file.c index b926d57..53b9c4a 100644 --- a/file.c +++ b/file.c @@ -1,4 +1,4 @@ -/* $Id: file.c,v 1.64 2002/02/05 03:45:33 ukai Exp $ */ +/* $Id: file.c,v 1.65 2002/02/05 11:58:04 ukai Exp $ */ #include "fm.h" #include #include "myctype.h" @@ -6818,7 +6818,7 @@ void doFileCopy(char *tmpf, char *defstr) { Str msg; - char filen[256]; + Str filen; char *p, *q; if (fmInitialized) { @@ -6850,10 +6850,10 @@ doFileCopy(char *tmpf, char *defstr) if (q == NULL || *q == '\0') { printf("(Download)Save file to: "); fflush(stdout); - p = fgets(filen, sizeof(filen), stdin); - if (p == NULL || filen[0] == '\0') + filen = Strfgets(stdin); + if (filen->length == 0) return; - q = filen; + q = filen->ptr; } for (p = q + strlen(q) - 1; IS_SPACE(*p); p--) ; *(p + 1) = '\0'; @@ -6886,7 +6886,7 @@ void doFileSave(URLFile uf, char *defstr) { Str msg; - char filen[256]; + Str filen; char *p, *q; if (fmInitialized) { @@ -6915,10 +6915,10 @@ doFileSave(URLFile uf, char *defstr) if (q == NULL || *q == '\0') { printf("(Download)Save file to: "); fflush(stdout); - p = fgets(filen, sizeof(filen), stdin); - if (p == NULL || filen[0] == '\0') + filen = Strfgets(stdin); + if (filen->length == 0) return; - q = filen; + q = filen->ptr; } for (p = q + strlen(q) - 1; IS_SPACE(*p); p--) ; *(p + 1) = '\0'; -- cgit v1.2.3