lynx-dev
[Top][All Lists]
Advanced

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

Re: lynx-dev one of my bookmark files is now double spaced (patch)


From: Eduardo Chappa L.
Subject: Re: lynx-dev one of my bookmark files is now double spaced (patch)
Date: Mon, 27 Sep 1999 19:01:23 -0700 (PDT)

Patch for Lynx Version 2.8.3dev.9 (Overrides earlier patch)

 * This patch fixes the creation of a new bookmark file and takes care
   that older bookmarks files do not fall into the same bug anymore by 
   making sure the <ol> tag is in a line by itself. This correction will
   only be activated when the first bookmark is attempted to be erased.


diff -rc lynx2-8-3/src/LYBookmark.c lynx2-8-3.newpatch/src/LYBookmark.c
*** lynx2-8-3/src/LYBookmark.c  Fri Jul 30 08:39:54 1999
--- lynx2-8-3.newpatch/src/LYBookmark.c Mon Sep 27 18:48:42 1999
***************
*** 387,393 ****
        fprintf(fp,
            gettext("     You can delete links by the 'R' key<br>\n<ol>\n"));
  #else
!       fprintf(fp, "%s<br>\n%s\n\n<!--\n%s\n-->\n\n<p>\n<ol>",
                    gettext("\
       You can delete links using the remove bookmark command.  It is usually\n\
       the 'R' key but may have been remapped by you or your system\n\
--- 387,393 ----
        fprintf(fp,
            gettext("     You can delete links by the 'R' key<br>\n<ol>\n"));
  #else
!       fprintf(fp, "%s<br>\n%s\n\n<!--\n%s\n-->\n\n<p>\n<ol>\n",
                    gettext("\
       You can delete links using the remove bookmark command.  It is usually\n\
       the 'R' key but may have been remapped by you or your system\n\
***************
*** 530,544 ****
        }
  
      } else {
!       char *cp;
        BOOLEAN retain;
        int seen;
  
        n = -1;
        while (LYSafeGets(&buf, fp) != NULL) {
            retain = TRUE;
            seen = 0;
            cp = buf;
            while (n < cur && (cp = LYstrstr(cp, "<a href="))) {
                seen++;
                if (++n == cur) {
--- 530,548 ----
        }
  
      } else {
!       char *cp, *cp2;
        BOOLEAN retain;
        int seen;
  
        n = -1;
        while (LYSafeGets(&buf, fp) != NULL) {
+           int keep_ol = FALSE;
            retain = TRUE;
            seen = 0;
            cp = buf;
+           if ((cur == 0) && (cp2 = LYstrstr(cp,"<ol><LI>")))
+               keep_ol = TRUE; /* Do not erase, this corrects a bug in an
+                                  older version */
            while (n < cur && (cp = LYstrstr(cp, "<a href="))) {
                seen++;
                if (++n == cur) {
***************
*** 548,553 ****
--- 552,559 ----
                        goto failure;
                    }
                    CTRACE(tfp, "remove_bookmark_link: skipping link %d\n", n);
+                   if (keep_ol)
+                       fprintf(nfp,"<ol>\n");
                    retain = FALSE;
                }
                cp += 8;

    Thanks, have a nice day.

Eduardo
http://www.math.washington.edu/~chappa/personal.html


reply via email to

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