lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev patch: fix for disappearing empty lines when dump'ing


From: Vlad Harchev
Subject: lynx-dev patch: fix for disappearing empty lines when dump'ing
Date: Wed, 5 Jan 2000 23:09:41 +0400 (SAMT)

* Now it's guaranteed that LY_SOFT_NEWLINE could be only 0th character in
  line->data (it could be preceeded by LY_*_START_CHAR). Bug that causedd
  empty lines to disappear when printing files was fixed.

Comments:
 Tom, expect a huge offsets applying this patch (I still use pre-dev16, and it
differs from dev17 in so many of places...). I inserted fragments of dev17's
print_*_to_fd to dev16's GridText.c, saved as 'old/src/GridText.c', edited and
tested code, and saved as 'fixef/src/GridText.c', and made a diff (So I hope
that 'patch' won't bark). 
  1st hunk is at the very begining of split_line.

 Best regards,
  -Vlad

diff -ru old/src/GridText.c fixed/src/GridText.c
--- old/src/GridText.c  Sun Jan  9 06:15:29 2000
+++ fixed/src/GridText.c        Sun Jan  9 06:26:18 2000
@@ -2385,6 +2385,22 @@
     cur_hy_word_size = 0;
 #endif
 
+    cp = previous->data;
+    if (cp[0] == LY_BOLD_START_CHAR || cp[0] == LY_UNDERLINE_START_CHAR) {
+       switch (cp[1]) {
+           case LY_SOFT_NEWLINE:
+               cp[1] = cp[0];
+               cp[0] = LY_SOFT_NEWLINE;
+               break;
+           case LY_BOLD_START_CHAR:
+           case LY_UNDERLINE_START_CHAR:
+               if (cp[2]==LY_SOFT_NEWLINE) {
+                   cp[2] = cp[1];
+                   cp[1] = cp[0];
+                   cp[0] = LY_SOFT_NEWLINE;
+               };
+       };
+    };
     if (split > previous->size) {
        CTRACE((tfp,
               "*** split_line: split==%d greater than last_line->size==%d !\n",
@@ -7572,11 +7588,7 @@
 
     line = HTMainText->last_line->next;
     for (;; line = line->next) {
-       if (!first &&
-        line->data[0] != LY_SOFT_NEWLINE &&
-        line->data[0] != '\0' &&
-        line->data[1] != LY_SOFT_NEWLINE) {
-           /* data[0] can be LY_*START_CHAR, so LY_SOFT_NEWLINE can be in [1] 
- VH */
+       if (!first && line->data[0] != LY_SOFT_NEWLINE) {
            fputc('\n',fp);
            /*
             *  Add news-style quotation if requested. - FM
@@ -7699,9 +7711,7 @@
     }
 
     for (;; line = line->next) {
-       if (!first
-        && line->data[0] != LY_SOFT_NEWLINE && line->data[1] != 
LY_SOFT_NEWLINE)
-           /* data[0] can be LY_*START_CHAR, so LY_SOFT_NEWLINE can be in [1] 
- VH */
+       if (!first && line->data[0] != LY_SOFT_NEWLINE)
            fputc('\n',fp);
        first = FALSE;
        /*


reply via email to

[Prev in Thread] Current Thread [Next in Thread]