aboutsummaryrefslogtreecommitdiffstats
path: root/etc.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-11-27 16:39:13 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-11-27 16:39:13 +0000
commit7b5f6ea99c626ab25b5636921336109c329617d7 (patch)
tree72db86d3cefb7c119eef0246b7ead94ac4fbf6fc /etc.c
parent[w3m-dev 03495] local CGI can't work (diff)
downloadw3m-7b5f6ea99c626ab25b5636921336109c329617d7.tar.gz
w3m-7b5f6ea99c626ab25b5636921336109c329617d7.zip
[w3m-dev 03496] parse <!-- ... --> in <script>
* etc.c (read_token): check <pre> * file.c (HTMLlineproc0): remove comment processing check pre mode comment processing move From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
Diffstat (limited to 'etc.c')
-rw-r--r--etc.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/etc.c b/etc.c
index 0f98636..37126db 100644
--- a/etc.c
+++ b/etc.c
@@ -1,4 +1,4 @@
-/* $Id: etc.c,v 1.40 2002/11/24 16:02:22 ukai Exp $ */
+/* $Id: etc.c,v 1.41 2002/11/27 16:39:17 ukai Exp $ */
#include "fm.h"
#include <pwd.h>
#include "myctype.h"
@@ -755,8 +755,10 @@ read_token(Str buf, char **instr, int *status, int pre, int append)
}
if (prev_status == R_ST_NCMNT2 || prev_status == R_ST_NCMNT3 ||
prev_status == R_ST_IRRTAG || prev_status == R_ST_CMNT1) {
- if (prev_status == R_ST_CMNT1 && !append)
+ if (prev_status == R_ST_CMNT1 && !append && !pre)
Strclear(buf);
+ if (pre)
+ Strcat_char(buf, *p);
p++;
goto proc_end;
}
@@ -779,7 +781,10 @@ read_token(Str buf, char **instr, int *status, int pre, int append)
}
if (*status == R_ST_TAG0 && !REALLY_THE_BEGINNING_OF_A_TAG(p)) {
/* it seems that this '<' is not a beginning of a tag */
+/*
Strcat_charp(buf, "&lt;");
+*/
+ Strcat_char(buf, '<');
*status = R_ST_NORMAL;
}
else
@@ -793,7 +798,9 @@ read_token(Str buf, char **instr, int *status, int pre, int append)
break;
case R_ST_CMNT:
case R_ST_IRRTAG:
- if (!append)
+ if (pre)
+ Strcat_char(buf, *p);
+ else if (!append)
Strclear(buf);
break;
case R_ST_CMNT1:
@@ -802,6 +809,8 @@ read_token(Str buf, char **instr, int *status, int pre, int append)
case R_ST_NCMNT2:
case R_ST_NCMNT3:
/* do nothing */
+ if (pre)
+ Strcat_char(buf, *p);
break;
}
}