diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-02-05 11:58:03 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2002-02-05 11:58:03 +0000 |
commit | 32087595f702848519db3c9c8c77716e78f95aca (patch) | |
tree | 7e928f62859e837363ee2d161f9e6b3946c2f161 /file.c | |
parent | [w3m-dev 02989] (diff) | |
download | w3m-32087595f702848519db3c9c8c77716e78f95aca.tar.gz w3m-32087595f702848519db3c9c8c77716e78f95aca.zip |
[w3m-dev 02990]
* file.c (doFileCopy): use Strfgets() instead of fgets()
* file.c (doFileSave): ditto
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat (limited to 'file.c')
-rw-r--r-- | file.c | 18 |
1 files changed, 9 insertions, 9 deletions
@@ -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 <sys/types.h> #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'; |