aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2003-01-29 17:38:12 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2003-01-29 17:38:12 +0000
commit931a54afec82cbbc0eff2f08a3146de2aefe17f6 (patch)
treef79751e9584c5064fe0de616d543edbafec59e5c /file.c
parent[w3m-dev-en 00852] Re: Enhancement: content type detection of files (diff)
downloadw3m-931a54afec82cbbc0eff2f08a3146de2aefe17f6.tar.gz
w3m-931a54afec82cbbc0eff2f08a3146de2aefe17f6.zip
[w3m-dev 03709] Re: view source, edit source
* display.c (displayBuffer): INIT_BUFFER_WIDTH * file.c (_saveBuffer): added (saveBuffer): use _saveBuffer (saveBufferBody): added * main.c (vmSrc): saveBufferBody * proto.h (saveBufferBody): added From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'file.c')
-rw-r--r--file.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/file.c b/file.c
index 6010179..68537a9 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.212 2003/01/29 17:26:51 ukai Exp $ */
+/* $Id: file.c,v 1.213 2003/01/29 17:38:14 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -6963,10 +6963,9 @@ conv_rule(Line *l)
/*
* saveBuffer: write buffer to file
*/
-void
-saveBuffer(Buffer *buf, FILE * f, int cont)
+static void
+_saveBuffer(Buffer *buf, Line *l, FILE * f, int cont)
{
- Line *l = buf->firstLine;
Str tmp;
#ifndef KANJI_SYMBOLS
@@ -6995,6 +6994,22 @@ saveBuffer(Buffer *buf, FILE * f, int cont)
}
}
+void
+saveBuffer(Buffer *buf, FILE * f, int cont)
+{
+ _saveBuffer(buf, buf->firstLine, f, cont);
+}
+
+void
+saveBufferBody(Buffer *buf, FILE * f, int cont)
+{
+ Line *l = buf->firstLine;
+
+ while (l != NULL && l->real_linenumber == 0)
+ l = l->next;
+ _saveBuffer(buf, l, f, cont);
+}
+
static Buffer *
loadcmdout(char *cmd,
Buffer *(*loadproc) (URLFile *, Buffer *), Buffer *defaultbuf)