lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev [patch] fix accept/reject domains not written to .lynxrc


From: brian j. pardy
Subject: lynx-dev [patch] fix accept/reject domains not written to .lynxrc
Date: Wed, 27 Jan 1999 20:29:47 -0800

I think I intended to fix this a long time ago, or just didn't think
it through.  If someone has domains specified in COOKIE_ACCEPT_DOMAINS
or COOKIE_REJECT_DOMAINS in .lynxrc, these domains will not be written
back out to .lynxrc upon writing changes to disk from the options
screen.  Can you tell I always use vi to set options instead? :)

Also a few clarifications to comments, to make them more in line with
code, or more better grammar.  Also a typofix.

Hmm.  In doing this, I saw something that I'd appreciate feedback on:

Presently, if you delete an always-accept or always-reject domain from
the cookie jar page, it'll come back the next time Lynx starts up,
because that doesn't affect the variable they are stored in, or (now,
with this patch) the .lynxrc setting.  Do we want to rip a domain out
of COOKIE_ACCEPT_DOMAINS in .lynxrc if it is deleted from the cookie
jar?  I'd tend to think so.



diff -cr 2.8.2dev.14/src/LYCookie.c 2.8.2dev.14.bjp/src/LYCookie.c
*** 2.8.2dev.14/src/LYCookie.c  Thu Dec 24 03:27:23 1998
--- 2.8.2dev.14.bjp/src/LYCookie.c      Wed Jan 27 20:01:08 1999
***************
*** 2004,2010 ****
         *  COOKIE_FLAG_EXPIRES_SET  It must have had an explicit
         *                           expiration originally, otherwise
         *                           it would not be in the file.
!        *  COOKIE_FLAG_DOMAN_SET,   We don't know whether these were
         *   COOKIE_FLAG_PATH_SET    explicit or implicit, but this
         *                           only matters for sending version 1
         *                           cookies; the cookies read from the
--- 2004,2010 ----
         *  COOKIE_FLAG_EXPIRES_SET  It must have had an explicit
         *                           expiration originally, otherwise
         *                           it would not be in the file.
!        *  COOKIE_FLAG_DOMAIN_SET,  We don't know whether these were
         *   COOKIE_FLAG_PATH_SET    explicit or implicit, but this
         *                           only matters for sending version 1
         *                           cookies; the cookies read from the
***************
*** 2618,2624 ****
      int isexisting = FALSE;
  
      /*
!      * Is this the first cookie we're handling?  If so, initialize
       * domain_list.
       */
  
--- 2618,2624 ----
      int isexisting = FALSE;
  
      /*
!      * Is this the first domain we're handling?  If so, initialize
       * domain_list.
       */
  
***************
*** 2635,2642 ****
      while ((strsmall = LYstrsep(str, ",")) != 0) {
  
        /*
!        * Check the list of existing cookies to see if this is a
!        * re-setting of an already existing cookie -- if so, just
         * change the behavior, if not, create a new domain entry.
         */
  
--- 2635,2642 ----
      while ((strsmall = LYstrsep(str, ",")) != 0) {
  
        /*
!        * Check the list of existing domains to see if this is a
!        * re-setting of an already existing domains -- if so, just
         * change the behavior, if not, create a new domain entry.
         */
  
***************
*** 2694,2700 ****
      int isexisting = FALSE;
  
      /*
!      * Is this the first cookie we're handling?  If so, initialize
       * domain_list.
       */
  
--- 2694,2700 ----
      int isexisting = FALSE;
  
      /*
!      * Is this the first domain we're handling?  If so, initialize
       * domain_list.
       */
  
***************
*** 2711,2718 ****
      while ((strsmall = LYstrsep(str, ",")) != 0) {
  
        /*
!        * Check the list of existing cookies to see if this is a
!        * re-setting of an already existing cookie -- if so, just
         * change the behavior, if not, create a new domain entry.
         */
  
--- 2711,2718 ----
      while ((strsmall = LYstrsep(str, ",")) != 0) {
  
        /*
!        * Check the list of existing domains to see if this is a
!        * re-setting of an already existing domains -- if so, just
         * change the behavior, if not, create a new domain entry.
         */
  
diff -cr 2.8.2dev.14/src/LYrcFile.c 2.8.2dev.14.bjp/src/LYrcFile.c
*** 2.8.2dev.14/src/LYrcFile.c  Wed Jan 27 19:57:57 1999
--- 2.8.2dev.14.bjp/src/LYrcFile.c      Wed Jan 27 20:20:30 1999
***************
*** 470,475 ****
--- 470,479 ----
            while (isspace(*cp))
                cp++; /* get rid of spaces */
            cookie_add_acceptlist(cp);
+           if(LYCookieAcceptDomains != NULL) {
+                   StrAllocCat(LYCookieAcceptDomains, ",");
+           }
+           StrAllocCat(LYCookieAcceptDomains, cp);
  
  
        /*
***************
*** 482,491 ****
            while (isspace(*cp))
                cp++; /* get rid of spaces */
            cookie_add_rejectlist(cp);
  
  #ifdef EXP_PERSISTENT_COOKIES
        /*
!        *  File to store cookies in.
         */
        } else if ((cp = LYstrstr(line_buffer, "cookie_file"))
                != NULL && cp-line_buffer < number_sign) {
--- 486,499 ----
            while (isspace(*cp))
                cp++; /* get rid of spaces */
            cookie_add_rejectlist(cp);
+           if(LYCookieRejectDomains != NULL) {
+                   StrAllocCat(LYCookieRejectDomains, ",");
+           }
+           StrAllocCat(LYCookieRejectDomains, cp);
  
  #ifdef EXP_PERSISTENT_COOKIES
        /*
!        *  File in which to store persistent cookies.
         */
        } else if ((cp = LYstrstr(line_buffer, "cookie_file"))
                != NULL && cp-line_buffer < number_sign) {
***************
*** 960,973 ****
  # override any settings made here.  If a single domain is specified in\n\
  # both cookie_accept_domains and in cookie_reject_domains, the rejection\n\
  # will take precedence.\n"));
!     fprintf(fp, "# cookie_accept_domains=\n");
!     fprintf(fp, "# cookie_reject_domains=\n\n");
  
-     /*
-      *  cookie_accept_domains and cookie_reject_domains not set here because
-      *  there's not currently a method on the options menu (maybe later?)
-      *  to set them.
-      */
  
  #ifdef EXP_PERSISTENT_COOKIES
      /*
--- 968,980 ----
  # override any settings made here.  If a single domain is specified in\n\
  # both cookie_accept_domains and in cookie_reject_domains, the rejection\n\
  # will take precedence.\n"));
!     fprintf(fp, "cookie_accept_domains=%s\n",
!                   (LYCookieAcceptDomains == NULL ? "" 
!                   : LYCookieAcceptDomains));
!     fprintf(fp, "cookie_reject_domains=%s\n\n",
!                   (LYCookieRejectDomains == NULL ? "" 
!                   : LYCookieRejectDomains));
  
  
  #ifdef EXP_PERSISTENT_COOKIES
      /*

-- 
Lewis's Law of Travel:
        The first piece of luggage out of the
        chute doesn't belong to anyone, ever.

reply via email to

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