diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2001-12-26 18:29:33 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2001-12-26 18:29:33 +0000 |
commit | e6b49bac2eed9c5ce7680bdbb4a677e4b82e77cc (patch) | |
tree | 914e0b0d4710bd4a2a7d49b3299464646c699701 /form.c | |
parent | [w3m-dev 02748] cleanup code for restoring cursor position (diff) | |
download | w3m-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.c | 25 |
1 files changed, 7 insertions, 18 deletions
@@ -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 |