lynx-dev
[Top][All Lists]
Advanced

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

LYNX-DEV DOS patches for development code ac-0.87


From: Doug Kaufman
Subject: LYNX-DEV DOS patches for development code ac-0.87
Date: Sat, 25 Oct 1997 21:46:19 -0700 (PDT)

About a month ago I submitted a patch to fix LYNX_TEMP_SPACE  and to
make the tempname for files conform to 8+3 naming convention for DOS.  I
didn't see any posts with problems regarding these changes, but they
weren't incorporated into the code.  Is there a problem with them? The
original post is at
"http://www.flora.org/lynx-dev/html/month0997/msg00699.html";. An update
for ac-0.87 is at the end of this post.

Another problem is that BOXHORI and BOXVERT are defined in two different
places, userdefs.h and LYCurses.h.  I would suggest that one place be
picked and the other eliminated.  I don't know which site is preferable.


*** lynx2-7-1/src/LYMain.c      Wed Oct 22 12:24:12 1997
--- lynx2-7-1/src/LYMain.c.new  Sat Oct 25 19:50:00 1997
***************
*** 658,663 ****
--- 658,666 ----
      StrAllocCat(lynx_version_putenv_command, LYNX_VERSION);
      putenv(lynx_version_putenv_command);
  #endif /* VMS */
+     if ((cp = getenv("LYNX_TEMP_SPACE")) != NULL)
+         StrAllocCopy(lynx_temp_space, cp);
+     else
  #ifdef DOSPATH
         if ((cp = getenv("TEMP")) != NULL)
                  StrAllocCopy(lynx_temp_space, cp);
***************
*** 665,673 ****
                  StrAllocCopy(lynx_temp_space, cp);
         else
  #endif
-     if ((cp = getenv("LYNX_TEMP_SPACE")) != NULL)
-         StrAllocCopy(lynx_temp_space, cp);
-     else
          StrAllocCopy(lynx_temp_space, TEMP_SPACE);
      if ((cp = strchr(lynx_temp_space, '~'))) {
        *(cp++) = '\0';
--- 668,673 ----
***************
*** 720,730 ****
--- 720,738 ----
        StrAllocCat(lynx_temp_space, ":");
      }
  #else
+ #ifndef __DJGPP__
      {
        if (((len = strlen(lynx_temp_space)) > 1) &&
            lynx_temp_space[len-1] != '/') {
            StrAllocCat(lynx_temp_space, "/");
        }
+ #else
+     {
+       if (((len = strlen(lynx_temp_space)) > 1) &&
+           lynx_temp_space[len-1] != '\\') {
+           StrAllocCat(lynx_temp_space, "\\");
+       }
+ #endif /* __DJGPP__ */
      }
  #endif /* VMS */
  #ifdef VMS
*** lynx2-7-1/src/LYUtils.c     Sat Oct 11 11:08:32 1997
--- lynx2-7-1/src/LYUtils.c.new Sat Oct 25 19:50:20 1997
***************
*** 3223,3235 ****
--- 3223,3249 ----
  {
      static int counter = 0;
      FILE *fp = NULL;
+ #ifdef FNAMES_8_3
+     int LYMaxTempCount = 1000; /* Arbitrary limit.  Make it configurable? */
+ #else
      int LYMaxTempCount = 10000; /* Arbitrary limit.  Make it configurable? */
+ #endif /* FNAMES_8_3 */
  
      if (action == REMOVE_FILES) {
          /*
         *  Remove all temporary files with .txt or .html suffixes. - FM
         */ 
        for (; counter > 0; counter--) {
+ #ifdef FNAMES_8_3
+           sprintf(namebuffer,
+                   "%s%d%u.txt",
+                   lynx_temp_space, (int)getpid(), counter-1);
+           remove(namebuffer);
+           sprintf(namebuffer,
+                   "%s%d%u%s",
+                   lynx_temp_space, (int)getpid(), counter-1, HTML_SUFFIX);
+           remove(namebuffer);
+ #else
            sprintf(namebuffer,
                    "%sL%d%uTMP.txt",
                    lynx_temp_space, (int)getpid(), counter-1);
***************
*** 3238,3243 ****
--- 3252,3258 ----
                    "%sL%d%uTMP%s",
                    lynx_temp_space, (int)getpid(), counter-1, HTML_SUFFIX);
            remove(namebuffer);
+ #endif /* FNAMES_8_3 */
        }
      } else {
          /*
***************
*** 3257,3265 ****
--- 3272,3286 ----
             *  should be done consistently by always using HTML_SUFFIX
             *  where filenames are generated for new local files. - kw
             */
+ #ifdef FNAMES_8_3
+           sprintf(namebuffer,
+                   "%s%d%u.txt",
+                   lynx_temp_space, (int)getpid(), counter);
+ #else
            sprintf(namebuffer,
                    "%sL%d%uTMP.txt",
                    lynx_temp_space, (int)getpid(), counter);
+ #endif /* FNAMES_8_3
            if ((fp = fopen(namebuffer, "r")) != NULL) {
                fclose(fp);
                if (TRACE)
***************
*** 3269,3277 ****
--- 3290,3304 ----
                counter++;
                continue;
            }
+ #ifdef FNAMES_8_3
+           sprintf(namebuffer,
+                   "%s%d%u.bin",
+                   lynx_temp_space, (int)getpid(), counter);
+ #else
            sprintf(namebuffer,
                    "%sL%d%uTMP.bin",
                    lynx_temp_space, (int)getpid(), counter);
+ #endif /* FNAMES_8_3 */
            if ((fp = fopen(namebuffer, "r")) != NULL) {
                fclose(fp);
                if (TRACE)
***************
*** 3281,3289 ****
--- 3308,3322 ----
                counter++;
                continue;
            }
+ #ifdef FNAMES_8_3
+           sprintf(namebuffer,
+                   "%s%d%u%s",
+                   lynx_temp_space, (int)getpid(), counter++, HTML_SUFFIX);
+ #else
            sprintf(namebuffer,
                    "%sL%d%uTMP%s",
                    lynx_temp_space, (int)getpid(), counter++, HTML_SUFFIX);
+ #endif /* FNAMES_8_3 */
            if ((fp = fopen(namebuffer, "r")) != NULL) {
                fclose(fp);
                if (TRACE)

                                  Doug
__
Doug Kaufman
Internet: address@hidden (preferred)
          address@hidden

;
; To UNSUBSCRIBE:  Send a mail message to address@hidden
;                  with "unsubscribe lynx-dev" (without the
;                  quotation marks) on a line by itself.
;

reply via email to

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