lynx-dev
[Top][All Lists]
Advanced

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

[Patch] Re: lynx-dev Borland compiles


From: Hiroyuki Senshu
Subject: [Patch] Re: lynx-dev Borland compiles
Date: Fri, 21 Jul 2000 14:22:13 +0900

I experienced the same phenomenon, too.
The patch of the countermeasure is added in the following.
(This code contains other expansion.)

address@hidden wrote:
>In a recent note, Lloyd Rasmussen said:
>
>> Date: Thu, 20 Jul 2000 22:32:26 -0400
>> 
>> On Wed, 19 Jul 2000 23:22:22 -0400, Webmaster Jim wrote:
>> 
>> >the other is 2.8.4dev6. I could not find the problem with pop-up video
>> >attributes for the release, so I'm giving up. It is working correctly in
>> >2.8.4.
>> >
>> Hi, Jim.  I didn't have the patience to follow this up, but I
>> experienced the following on 2.8.4 dev 6:  I decided to save the
>> currently displayed page to disk from the Print menu.  I used ctrl-U to
>> clear the supplied filename and typed my own.  The save succeeded, but
>> Lynx must have exited immediately afterward, because I was dumped back
>> onto the desktop without warning at that point.  I don't have that sort
>> of problem with 2.8.3 rel.  I do have a working Temp directory.  I ran
>> Lynx from my existing lynx.cfg.  This is in Win98 with the Vocal-Eyes
>> DOS screen reader.
>> 
>I'm getting something similar with dev.6 on Solaris and OS/390:
>
>Start Lynx
>"o" for options
>down arrow to "Type of Search"
>right arrow to pop up menu
>down arrow to "Case sensitive"
>right arrow to select
>
>    A Fatal error has occurred in Lynx Ver. 2.8.4dev.6
>
>    Please notify your system administrator to confirm a bug, and
>    if confirmed, to notify the lynx-dev list.  Bug reports should
>    have concise descriptions of the command and/or URL which causes
>    the problem, the operating system name with version number, the
>    TCPIP implementation, and any other relevant information.
>
>    Do NOT mail the core file if one was generated.
>
>    Lynx now exiting with signal:  11
>
>    Abort(coredump)
>    address@hidden:160$ uname -a
>    SunOS sanitas 5.6 Generic_105181-13 sun4u sparc SUNW,Ultra-5_10
>    address@hidden:161$
>
>On Solaris, problem occurs with dev.6 and dev.5; not with dev.4
>
>-- gil


diff -Bur lynx284.d06/WWW/Library/Implementation/HTTCP.c 
lynx284.w32/WWW/Library/Implementation/HTTCP.c
--- lynx284.d06/WWW/Library/Implementation/HTTCP.c      Fri Apr 14 12:29:20 
2000
+++ lynx284.w32/WWW/Library/Implementation/HTTCP.c      Tue Jul 18 19:46:08 
2000
@@ -100,21 +100,20 @@
 #endif /* DECL_SYS_ERRLIST */
 
 #ifdef _WINDOWS_NSL
-char host[512];
 struct hostent  *phost;        /* Pointer to host - See netdb.h */
 int donelookup;
 
-static unsigned long _fork_func (void *arglist)
+static unsigned long _fork_func (void *hostname)
 {
 #ifdef SH_EX
     unsigned long addr;
-    addr = (unsigned long)inet_addr(host);
+    addr = (unsigned long)inet_addr(hostname);
     if ((int)addr != -1)
        phost = gethostbyaddr((char *)&addr, sizeof (addr), AF_INET);
     else
-       phost = gethostbyname(host);
+       phost = gethostbyname(hostname);
 #else
-    phost = gethostbyname(host);
+    phost = gethostbyname(hostname);
 #endif
     donelookup = TRUE;
     return (unsigned long)(phost);
@@ -625,9 +624,7 @@
 PUBLIC struct hostent * LYGetHostByName ARGS1(
        char *, str)
 {
-#ifndef _WINDOWS_NSL
-    char *host = str;
-#endif
+    CONST char *host = str;
 #ifdef NSL_FORK
     /* for transfer of result between from child to parent: */
     static struct {
@@ -678,10 +675,6 @@
        return NULL;
     }
 
-#ifdef _WINDOWS_NSL
-    strncpy(host, str, (size_t)512);
-#endif /*  _WINDOWS_NSL */
-
     if (!valid_hostname(host)) {
        lynx_nsl_status = HT_NOT_ACCEPTABLE;
 #ifdef NO_RECOVERY
@@ -1084,12 +1077,24 @@
            donelookup = FALSE;
            hThread = CreateThread((void *)NULL, 4096UL,
                (LPTHREAD_START_ROUTINE)_fork_func,
-               (void *)NULL, 0UL, (unsigned long *)&dwThreadID);
+               (void *)host, 0UL, (unsigned long *)&dwThreadID);
+#ifdef WIN_EX  /* Thread fail FIX 2000/04/06 (Thu) 09:11:13 */
+           if (!hThread) {
+               MessageBox((void *)NULL, 
+                       "CreateThread", "CreateThread Failed", 0L);
+                   lynx_nsl_status = HT_INTERRUPTED;
+                   return NULL;
+           }
+#else
            if (!hThread)
                MessageBox((void *)NULL, "CreateThread",
                           "CreateThread Failed", 0L);
+#endif
 
            while (!donelookup) {
+#ifdef WIN_EX  /* 2000/04/18 (Tue) 10:32:41 */
+               Sleep(50);
+#endif
                if (HTCheckForInterrupt()) {
                    /* Note that host is a character array and is not freed 
*/
                    /* to avoid possible subthread problems: */
@@ -1164,9 +1169,7 @@
     char *port;
     int dotcount_ip = 0;       /* for dotted decimal IP addr */
     char *strptr;
-#ifndef _WINDOWS_NSL
     char *host = NULL;
-#endif /* _WINDOWS_NSL */
 
     if (!str) {
        CTRACE((tfp, "HTParseInet: Can't parse `NULL'.\n"));
@@ -1177,11 +1180,7 @@
        CTRACE((tfp, "HTParseInet: INTERRUPTED for '%s'.\n", str));
        return -1;
     }
-#ifdef _WINDOWS_NSL
-    strncpy(host, str, (size_t)512);
-#else
     StrAllocCopy(host, str);   /* Make a copy we can mutilate */
-#endif /*  _WINDOWS_NSL */
     /*
     ** Parse port number if present.
     */
@@ -1209,9 +1208,7 @@
 #endif /* SUPPRESS */
        }
        if (strptr && *strptr != '\0') {
-#ifndef _WINDOWS_NSL
            FREE(host);
-#endif /* _WINDOWS_NSL */
            HTAlwaysAlert(NULL, gettext("Address has invalid port"));
            return -1;
        }
@@ -1260,9 +1257,7 @@
 #ifdef HAVE_INET_ATON
        if (!inet_aton(host, &(soc_in->sin_addr))) {
            CTRACE((tfp, "inet_aton(%s) returns error\n", host));
-#ifndef _WINDOWS_NSL
            FREE(host);
-#endif /* _WINDOWS_NSL */
            return -1;
        }
 #else
@@ -1271,9 +1266,7 @@
 #endif /* GUSI */
 #endif /* DGUX_OLD */
 #endif /* __DJGPP__ && !WATT32 */
-#ifndef _WINDOWS_NSL
        FREE(host);
-#endif /* _WINDOWS_NSL */
     } else {               /* Alphanumeric node name: */
 
 #ifdef MVS     /* Outstanding problem with crash in MVS gethostbyname */
@@ -1320,9 +1313,7 @@
        }
 #endif /* _WINDOWS_NSL */
 #endif /* __DJGPP__ && !WATT32 */
-#ifndef _WINDOWS_NSL
        FREE(host);
-#endif /* _WINDOWS_NSL */
 
     }  /* Alphanumeric node name */
 
@@ -1339,9 +1330,7 @@
 failed:
     CTRACE((tfp, "HTParseInet: Can't find internet node name `%s'.\n",
                host));
-#ifndef _WINDOWS_NSL
     FREE(host);
-#endif /* _WINDOWS_NSL */
     switch (lynx_nsl_status) {
     case HT_NOT_ACCEPTABLE:
     case HT_INTERRUPTED:
diff -Bur lynx284.d06/src/LYEditmap.c lynx284.w32/src/LYEditmap.c
--- lynx284.d06/src/LYEditmap.c Wed Dec 15 20:03:18 1999
+++ lynx284.w32/src/LYEditmap.c Tue Jul 18 19:46:08 2000
@@ -592,7 +592,11 @@
 LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
 LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
 LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+#ifdef CJK_EX  /* 2000/05/23 (Tue) 20:08:33 */
+LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
+#else
 LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_AIX,
+#endif
 /*                                               97 AIX    */
 LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
 LYE_CHAR,       LYE_CHAR,       LYE_CHAR,       LYE_CHAR,
diff -Bur lynx284.d06/src/LYGlobalDefs.h lynx284.w32/src/LYGlobalDefs.h
--- lynx284.d06/src/LYGlobalDefs.h      Tue Jul 18 19:38:08 2000
+++ lynx284.w32/src/LYGlobalDefs.h      Tue Jul 18 19:46:10 2000
@@ -57,7 +57,7 @@
 #define USE_PMDF_MAILER 0
 #endif
 
-#ifdef SH_EX
+#if defined(SH_EX) && defined(_WINDOWS)
 #define USE_BLAT_MAILER 1
 #else
 #define USE_BLAT_MAILER 0
@@ -473,13 +473,13 @@
 extern BOOLEAN system_is_NT;
 extern char windows_drive[4];
 extern int lynx_timeout;
-#endif /* _WINDOWS */
+#endif /* WIN_EX */
 
 #ifdef SH_EX
 extern BOOLEAN show_cfg;
 #ifdef WIN_EX
 extern int     debug_delay;
-#endif
+#endif /* WIN_EX */
 extern BOOLEAN no_table_center;
 #endif
 
diff -Bur lynx284.d06/src/LYMail.c lynx284.w32/src/LYMail.c
--- lynx284.d06/src/LYMail.c    Tue Jul 18 19:38:08 2000
+++ lynx284.w32/src/LYMail.c    Tue Jul 18 19:46:10 2000
@@ -478,7 +478,7 @@
        if (strlen(subject) > 70)
            subject[70] = '\0';
     } else
-#endif
+#endif /* USE_BLAT_MAILER */
     {
        if (mailto_type && *mailto_type) {
            fprintf(fd, "Mime-Version: 1.0\n");
@@ -650,7 +650,7 @@
                )
        );
     } else
-#endif
+#endif /* USE_BLAT_MAILER */
     {
        /* for sendmail.exe */
        StrAllocCopy(command, system_mail);
@@ -955,7 +955,7 @@
                )
        );
     else
-#endif
+#endif /* USE_BLAT_MAILER */
        HTSprintf0(&cmd, "%s -t \"%s\" -F %s", system_mail, address, 
my_tmpfile);
 
     LYSystem(cmd);     /* Mail (DOS/Windows) */
@@ -1961,7 +1961,7 @@
                fputs(header, fp);
 #else
            fputs(header, fp);
-#endif
+#endif /* USE_BLAT_MAILER */
            while ((n = fread(buf, 1, sizeof(buf), fd)) != 0) {
                fwrite(buf, 1, n, fp);
            }
@@ -1982,7 +1982,7 @@
                        )
                );
            } else
-#endif /* SH_EX */
+#endif /* USE_BLAT_MAILER */
            {
                StrAllocCopy(command, system_mail);
                StrAllocCat(command, " -t \"");
diff -Bur lynx284.d06/src/LYUtils.c lynx284.w32/src/LYUtils.c
--- lynx284.d06/src/LYUtils.c   Tue Jul 18 19:38:10 2000
+++ lynx284.w32/src/LYUtils.c   Thu Jul 20 10:35:06 2000
@@ -28,6 +28,7 @@
 #endif
 
 #if _WIN_CC
+#include <windows.h>
 extern int exec_command(char * cmd, int wait_flag); /* xsystem.c */
 #endif
 
@@ -2066,9 +2067,14 @@
 
     if (text != NULL && text[0] != '\0') {
 #ifdef HAVE_UTF8_STATUSLINES
-       if (LYCharSet_UC[current_char_set].enc == UCT_ENC_UTF8) {
+       if ((LYCharSet_UC[current_char_set].enc == UCT_ENC_UTF8) || 
+           (HTCJK != NOCJK)) {
            refresh();
        }
+#else
+       if (HTCJK != NOCJK) {
+           refresh();
+       }
 #endif /* HAVE_UTF8_STATUSLINES */
 #ifndef USE_COLOR_STYLE
        lynx_start_status_color ();
@@ -2248,11 +2254,11 @@
     int c;
     int cmd;
 #ifndef VMS /* UNIX stuff: */
-#ifndef USE_SLANG
+#if !(defined(_WINDOWS) || defined(USE_SLANG)) /* 2000/07/20 (Thu) 10:31:21 
*/
     struct timeval socket_timeout;
     int ret = 0;
     fd_set readfds;
-#endif /* !USE_SLANG */
+#endif /* !(_WINDOWS || USE_SLANG) */
 
     if (fake_zap > 0) {
        fake_zap--;
@@ -4913,10 +4919,6 @@
     char *Fragment = NULL;
     BOOLEAN GotHost = FALSE;
     BOOLEAN Startup = (BOOL) (helpfilepath == NULL);
-#ifdef _WINDOWS
-    int hoststat;
-    struct hostent  *phost;    /* Pointer to host - See netdb.h */
-#endif
 
     /*
      * If it's a NULL or zero-length string,
@@ -7180,8 +7182,10 @@
     if (!LYIsHtmlSep(*leaf))
        LYAddHtmlSep(target);
     StrAllocCat(*target, leaf);
+#if 0  /* !!! */
     if (leaf != source)
        FREE(leaf);
+#endif
 }
 
 #ifdef NOTDEFINED

--
Shonai College of Industry and Technology.
Electronics and Computer Information Course.
E-mail: address@hidden


; To UNSUBSCRIBE: Send "unsubscribe lynx-dev" to address@hidden

reply via email to

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