commit 441539df1c807173509e2d50286502b9b01693fa
parent 26697cd7d677e269ba44cc68bb6ddba19713983b
Author: ukai <ukai>
Date: Tue, 5 Feb 2002 11:58:03 +0000
[w3m-dev 02990]
* file.c (doFileCopy): use Strfgets() instead of fgets()
* file.c (doFileSave): ditto
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat:
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
@@ -1,5 +1,11 @@
2002-02-05 Fumitoshi UKAI <ukai@debian.or.jp>
+ * [w3m-dev 02990]
+ * file.c (doFileCopy): use Strfgets() instead of fgets()
+ * file.c (doFileSave): ditto
+
+2002-02-05 Fumitoshi UKAI <ukai@debian.or.jp>
+
* [w3m-dev 02989]
* file.c (inputAnswer): use Strfgets() instead of fgets()
diff --git a/file.c b/file.c
@@ -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';