aboutsummaryrefslogtreecommitdiffstats
path: root/form.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-12-26 18:29:33 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-12-26 18:29:33 +0000
commite6b49bac2eed9c5ce7680bdbb4a677e4b82e77cc (patch)
tree914e0b0d4710bd4a2a7d49b3299464646c699701 /form.c
parent[w3m-dev 02748] cleanup code for restoring cursor position (diff)
downloadw3m-e6b49bac2eed9c5ce7680bdbb4a677e4b82e77cc.tar.gz
w3m-e6b49bac2eed9c5ce7680bdbb4a677e4b82e77cc.zip
[w3m-dev 02749] cleanup code for editor,mailer,extbrowser
From: Hironori Sakamoto <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'form.c')
-rw-r--r--form.c25
1 files changed, 7 insertions, 18 deletions
diff --git a/form.c b/form.c
index 4efffc2..d4a5556 100644
--- a/form.c
+++ b/form.c
@@ -1,4 +1,4 @@
-/* $Id: form.c,v 1.7 2001/11/29 09:34:14 ukai Exp $ */
+/* $Id: form.c,v 1.8 2001/12/26 18:29:33 ukai Exp $ */
/*
* HTML forms
*/
@@ -453,14 +453,14 @@ form_fputs_decode(Str s, FILE * f)
void
input_textarea(FormItemList *fi)
{
- Str tmpname = tmpfname(TMPF_DFL, NULL);
+ char *tmpf = tmpfname(TMPF_DFL, NULL)->ptr;
Str tmp;
FILE *f;
#ifdef JP_CHARSET
char code = DisplayCode, ic;
#endif
- f = fopen(tmpname->ptr, "w");
+ f = fopen(tmpf, "w");
if (f == NULL) {
disp_err_message("Can't open temporary file", FALSE);
return;
@@ -468,25 +468,14 @@ input_textarea(FormItemList *fi)
if (fi->value)
form_fputs_decode(fi->value, f);
fclose(f);
- if (strcasestr(Editor, "%s"))
- if (strcasestr(Editor, "%d"))
- tmp = Sprintf(Editor, 1, tmpname->ptr);
- else
- tmp = Sprintf(Editor, tmpname->ptr);
- else {
- if (strcasestr(Editor, "%d"))
- tmp = Sprintf(Editor, 1);
- else
- tmp = Strnew_charp(Editor);
- Strcat_m_charp(tmp, " ", tmpname->ptr, NULL);
- }
+
fmTerm();
- system(tmp->ptr);
+ system(myEditor(Editor, tmpf, 1)->ptr);
fmInit();
if (fi->readonly)
return;
- f = fopen(tmpname->ptr, "r");
+ f = fopen(tmpf, "r");
if (f == NULL) {
disp_err_message("Can't open temporary file", FALSE);
return;
@@ -509,7 +498,7 @@ input_textarea(FormItemList *fi)
Strcat(fi->value, tmp);
}
fclose(f);
- unlink(tmpname->ptr);
+ unlink(tmpf);
}
void