w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit 1722dcf64614bdd9c8fa9a1c652b9560c007f26c
parent 2d86c8596ca1e22ab98c584d378832852978be1b
Author: ukai <ukai>
Date:   Tue,  3 Dec 2002 15:45:31 +0000

fix indent

Diffstat:
Mfile.c | 212++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mframe.c | 8++++----
Mtable.c | 8++++----
3 files changed, 114 insertions(+), 114 deletions(-)

diff --git a/file.c b/file.c @@ -5516,9 +5516,9 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal) char *str, *p; int is_tag = FALSE; int pre_mode = (obuf->table_level >= 0) ? tbl_mode->pre_mode : - obuf->flag; + obuf->flag; int end_tag = (obuf->table_level >= 0) ? tbl_mode->end_tag : - obuf->end_tag; + obuf->end_tag; if (*line == '<' || obuf->status != R_ST_NORMAL) { /* @@ -5527,7 +5527,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal) if (obuf->status == R_ST_EOL) obuf->status = R_ST_NORMAL; else { - read_token(h_env->tagbuf, &line, &obuf->status, + read_token(h_env->tagbuf, &line, &obuf->status, pre_mode & RB_PREMODE, obuf->status != R_ST_NORMAL); if (obuf->status != R_ST_NORMAL) return; @@ -5541,7 +5541,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal) else if (!(pre_mode & (RB_PLAIN | RB_INTXTA | RB_INSELECT | RB_SCRIPT | RB_STYLE))) { line = Strnew_m_charp(str + 1, line, NULL)->ptr; - str = "&lt;"; + str = "&lt;"; } } } @@ -5556,7 +5556,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal) RB_STYLE)) { if (is_tag) { p = str; - if ((tag = parse_tag(&p, internal))) { + if ((tag = parse_tag(&p, internal))) { if (tag->tagid == end_tag || (pre_mode & RB_INSELECT && tag->tagid == HTML_N_FORM)) goto proc_normal; @@ -5570,7 +5570,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal) continue; } if (is_tag) { - if (strncmp(str, "<!--", 4) && (p = strchr(str + 1, '<'))) { + if (strncmp(str, "<!--", 4) && (p = strchr(str + 1, '<'))) { str = Strnew_charp_n(str, p - str)->ptr; line = Strnew_m_charp(p, line, NULL)->ptr; } @@ -5581,7 +5581,7 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal) /* textarea */ if (pre_mode & RB_INTXTA) { feed_textarea(str); - continue; + continue; } /* script */ if (pre_mode & RB_SCRIPT) @@ -5667,126 +5667,126 @@ HTMLlineproc0(char *line, struct html_feed_environ *h_env, int internal) continue; } - while (*str) { - mode = get_mctype(str); - delta = get_mclen(mode); - if (obuf->flag & (RB_SPECIAL & ~RB_NOBR)) { - char ch = *str; - if (!(obuf->flag & RB_PLAIN) && (*str == '&')) { - char *p = str; - int ech = getescapechar(&p); - if (ech == '\n' || ech == '\r') { - ch = '\n'; - str = p - 1; - } - else if (ech == '\t') { - ch = '\t'; - str = p - 1; + while (*str) { + mode = get_mctype(str); + delta = get_mclen(mode); + if (obuf->flag & (RB_SPECIAL & ~RB_NOBR)) { + char ch = *str; + if (!(obuf->flag & RB_PLAIN) && (*str == '&')) { + char *p = str; + int ech = getescapechar(&p); + if (ech == '\n' || ech == '\r') { + ch = '\n'; + str = p - 1; + } + else if (ech == '\t') { + ch = '\t'; + str = p - 1; + } } - } - if (ch != '\n') - obuf->flag &= ~RB_IGNORE_P; - if (ch == '\n') { - str++; - if (obuf->flag & RB_IGNORE_P) { + if (ch != '\n') obuf->flag &= ~RB_IGNORE_P; - continue; + if (ch == '\n') { + str++; + if (obuf->flag & RB_IGNORE_P) { + obuf->flag &= ~RB_IGNORE_P; + continue; + } + if (obuf->flag & RB_PRE_INT) + PUSH(' '); + else + flushline(h_env, obuf, h_env->envs[h_env->envc].indent, + 1, h_env->limit); } - if (obuf->flag & RB_PRE_INT) - PUSH(' '); - else - flushline(h_env, obuf, h_env->envs[h_env->envc].indent, 1, - h_env->limit); - } - else if (ch == '\t') { - do { - PUSH(' '); - } while ((h_env->envs[h_env->envc].indent + obuf->pos) - % Tabstop != 0); - str++; - } - else if (obuf->flag & RB_PLAIN) { - char *p = html_quote_char(*str); - if (p) { - push_charp(obuf, 1, p, PC_ASCII); + else if (ch == '\t') { + do { + PUSH(' '); + } while ((h_env->envs[h_env->envc].indent + obuf->pos) + % Tabstop != 0); str++; } + else if (obuf->flag & RB_PLAIN) { + char *p = html_quote_char(*str); + if (p) { + push_charp(obuf, 1, p, PC_ASCII); + str++; + } + else { + proc_mchar(obuf, 1, delta, &str, mode); + } + } else { - proc_mchar(obuf, 1, delta, &str, mode); + if (*str == '&') + proc_escape(obuf, &str); + else + proc_mchar(obuf, 1, delta, &str, mode); } + if (obuf->flag & (RB_SPECIAL & ~RB_PRE_INT)) + continue; } else { - if (*str == '&') - proc_escape(obuf, &str); - else - proc_mchar(obuf, 1, delta, &str, mode); - } - if (obuf->flag & (RB_SPECIAL & ~RB_PRE_INT)) - continue; - } - else { - if (!IS_SPACE(*str)) - obuf->flag &= ~RB_IGNORE_P; - if ((mode == PC_ASCII || mode == PC_CTRL) && IS_SPACE(*str)) { - if (obuf->prevchar != ' ') { - PUSH(' '); + if (!IS_SPACE(*str)) + obuf->flag &= ~RB_IGNORE_P; + if ((mode == PC_ASCII || mode == PC_CTRL) && IS_SPACE(*str)) { + if (obuf->prevchar != ' ') { + PUSH(' '); + } + str++; } - str++; - } - else { + else { #ifdef JP_CHARSET - if (mode == PC_KANJI && - obuf->pos > h_env->envs[h_env->envc].indent && - Strlastchar(obuf->line) == ' ') { - while (obuf->line->length >= 2 && - !strncmp(obuf->line->ptr + obuf->line->length - 2, - " ", 2) - && obuf->pos >= h_env->envs[h_env->envc].indent) { - Strshrink(obuf->line, 1); - obuf->pos--; - } - if (obuf->line->length >= 3 && - obuf->prev_ctype == PC_KANJI && - Strlastchar(obuf->line) == ' ' && - obuf->pos >= h_env->envs[h_env->envc].indent) { - Strshrink(obuf->line, 1); - obuf->pos--; + if (mode == PC_KANJI && + obuf->pos > h_env->envs[h_env->envc].indent && + Strlastchar(obuf->line) == ' ') { + while (obuf->line->length >= 2 && + !strncmp(obuf->line->ptr + obuf->line->length - + 2, " ", 2) + && obuf->pos >= h_env->envs[h_env->envc].indent) { + Strshrink(obuf->line, 1); + obuf->pos--; + } + if (obuf->line->length >= 3 && + obuf->prev_ctype == PC_KANJI && + Strlastchar(obuf->line) == ' ' && + obuf->pos >= h_env->envs[h_env->envc].indent) { + Strshrink(obuf->line, 1); + obuf->pos--; + } } - } #endif /* JP_CHARSET */ - if (*str == '&') - proc_escape(obuf, &str); - else - proc_mchar(obuf, obuf->flag & RB_SPECIAL, delta, &str, - mode); + if (*str == '&') + proc_escape(obuf, &str); + else + proc_mchar(obuf, obuf->flag & RB_SPECIAL, delta, &str, + mode); + } } - } - if (need_flushline(h_env, obuf, mode)) { - char *bp = obuf->line->ptr + obuf->bp.len; - char *tp = bp - obuf->bp.tlen; - int i = 0; + if (need_flushline(h_env, obuf, mode)) { + char *bp = obuf->line->ptr + obuf->bp.len; + char *tp = bp - obuf->bp.tlen; + int i = 0; - if (tp > obuf->line->ptr && tp[-1] == ' ') - i = 1; + if (tp > obuf->line->ptr && tp[-1] == ' ') + i = 1; - indent = h_env->envs[h_env->envc].indent; - if (obuf->bp.pos - i > indent) { - Str line; - append_tags(obuf); - line = Strnew_charp(bp); - Strshrink(obuf->line, obuf->line->length - obuf->bp.len); + indent = h_env->envs[h_env->envc].indent; + if (obuf->bp.pos - i > indent) { + Str line; + append_tags(obuf); + line = Strnew_charp(bp); + Strshrink(obuf->line, obuf->line->length - obuf->bp.len); #ifdef FORMAT_NICE - if (obuf->pos - i > h_env->limit) - obuf->flag |= RB_FILL; + if (obuf->pos - i > h_env->limit) + obuf->flag |= RB_FILL; #endif /* FORMAT_NICE */ - back_to_breakpoint(obuf); - flushline(h_env, obuf, indent, 0, h_env->limit); + back_to_breakpoint(obuf); + flushline(h_env, obuf, indent, 0, h_env->limit); #ifdef FORMAT_NICE - obuf->flag &= ~RB_FILL; + obuf->flag &= ~RB_FILL; #endif /* FORMAT_NICE */ - HTMLlineproc1(line->ptr, h_env); + HTMLlineproc1(line->ptr, h_env); + } } - } } } if (!(obuf->flag & (RB_SPECIAL | RB_INTXTA | RB_INSELECT))) { diff --git a/frame.c b/frame.c @@ -625,7 +625,7 @@ createFrameFile(struct frameset *f, FILE * f1, Buffer *current, int level, is_tag = FALSE; } else if (pre_mode & RB_INSELECT) { - q = tok->ptr; + q = tok->ptr; if ((tag = parse_tag(&q, FALSE))) { if ((tag->tagid == end_tag) || (tag->tagid == HTML_N_FORM)) { @@ -639,11 +639,11 @@ createFrameFile(struct frameset *f, FILE * f1, Buffer *current, int level, switch (tag->tagid) { case HTML_TABLE: case HTML_N_TABLE: - CASE_TABLE_TAG: + CASE_TABLE_TAG: fputs("</SELECT>", f1); pre_mode = 0; end_tag = 0; - goto proc_normal; + goto proc_normal; } } } @@ -726,7 +726,7 @@ createFrameFile(struct frameset *f, FILE * f1, Buffer *current, int level, goto token_end; } break; - CASE_TABLE_TAG: + CASE_TABLE_TAG: /* table_tags MUST be in table stack */ if (!t_stack) { Strshrinkfirst(tok, 1); diff --git a/table.c b/table.c @@ -2517,7 +2517,7 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode, * <select> environment is regarded as the end of <select>. */ if (mode->pre_mode & TBLM_INSELECT) { switch (cmd) { - CASE_TABLE_TAG: + CASE_TABLE_TAG: case HTML_N_FORM: case HTML_N_SELECT: /* mode->end_tag */ table_close_select(tbl, mode, width); @@ -2528,7 +2528,7 @@ feed_table_tag(struct table *tbl, char *line, struct table_mode *mode, } if (mode->caption) { switch (cmd) { - CASE_TABLE_TAG: + CASE_TABLE_TAG: case HTML_N_CAPTION: mode->caption = 0; break; @@ -3211,9 +3211,9 @@ feed_table(struct table *tbl, char *line, struct table_mode *mode, line = ""; } if (mode->pre_mode & TBLM_PLAIN) - i = maximum_visible_length_plain(p); + i = maximum_visible_length_plain(p); else - i = maximum_visible_length(p); + i = maximum_visible_length(p); addcontentssize(tbl, i); setwidth(tbl, mode); if (nl)