Here are some small suggested changes to get the 2.8.7dev series going.
Several different problems are rolled into one patch (attached), so I'll
try to go over the problems and possible solutions.

1. When the "endwin" function was added for PDCurses in LYCurses.c, the
code to clear the screen for DJGPP and MingW was (accidentally)
orphaned, so both were leaving the screen filled at exit. In trying to
put back the screen clearing code, I noticed that the MingW code had
never really worked. This attempts to fix the screen clearing problem
for the two platforms.

2. For MingW, configure was finding that "ln -s" worked, when run under
Cygwin with -mno-cygwin. I put in code to override that, since the links
made by Cygwin were not usable without Cygwin.

3. For MingW, when I switched to gettext 0.15 from 0.11.5, gettext was
getting undefined in LYMain.c. For reasons not clear to me, one of the
changes in the gettext versions was to now define gettext for MingW as
a macro. This didn't work with the code in LYMain.c. I chose to define
"_INTL_REDIRECT_INLINE", which prevents gettext from being defined as a
macro. It might be more general to instead wrap the undef of gettext in
LYMain.c in "#ifndef _INTL_REDIRECT_MACROS", but I wasn't sure exactly
what the undefining was supposed to do, so I left it MingW specific.

4. Per the recent discussion about being able to prevent downloading
and saving to disk on Win98, where users have full control, I put in a
define "LYNX_CRIPPLED" which, when defined at compile time, should make
downloading and saving to disk difficult, and with no way to override
this with command line arguments or settings in lynx.cfg.

5. Minor changes regarding SPAWNING_MSG, so that it works as intended.
Note that the SPAWNING_MSG text already has a newline at its end.

6. Lastly, I put in some code to automatically put the lynx icon into
the MingW binary. This uses windres, the Windows resource compiler that
is part of GNU binutils. Other Windows builds can probably use the
LYIcon.rc file and lynx.ico files, since LYIcon.rc should also be
compatible with the Microsoft Windows resource compiler. I use the lynx
icon "lynx.ico" dated March 15, 1997, which has been distributed with
Wayne Buttles' Windows binary packages of lynx. If this were to be
distributed in the src directory of lynx packages, it would make it
easier for those building various Windows binaries. I put the icon up at
my website at "http://www.rahul.net/dkaufman/lynx.ico";.

I hope that I haven't introduced too many problems with these changes.

                        Doug

-- 
Doug Kaufman
Internet: [EMAIL PROTECTED]
--- lynx2.8.6rel.2/lynx2-8-6/configure.in.ori   2006-10-10 16:39:50.000000000 
-0700
+++ lynx2.8.6rel.2/lynx2-8-6/configure.in       2006-10-15 12:18:24.000000000 
-0700
@@ -84,6 +84,12 @@
 AC_PROG_CC
 AC_PROG_CPP
 AC_PROG_LN_S
+case $host_os in
+mingw*)
+       LN_S='cp -p'
+       AC_MSG_NOTICE([Overriding configure test for mingw to use cp -p for 
LN_S.])
+       ;;
+esac
 AC_PROG_MAKE_SET
 AC_PROG_INSTALL
 AC_CHECK_PROGS(LINT, lint alint lclint tdlint, [])
@@ -266,6 +272,9 @@
 linux*)
        TRY_CFLAGS="$TRY_CFLAGS -DLINUX"
        ;;
+mingw*)
+       TRY_CFLAGS="$TRY_CFLAGS -D_INTL_REDIRECT_INLINE"
+       ;;
 msdosdjgpp*)
        LIBS="$LIBS -lwatt"
        TRY_CFLAGS="$TRY_CFLAGS -DDOSPATH -DNOUSERS"
@@ -330,6 +339,13 @@
        ;;
 esac
 
+
+case $host_os in
+mingw*)
+       EXTRA_OBJS="$EXTRA_OBJS LYIcon\$o"
+       ;;
+esac
+
 CF_ANSI_CC_REQD
 
 dnl --------------------------------------------------------------------------
--- lynx2.8.6rel.2/lynx2-8-6/src/makefile.in.ori        2006-08-31 
16:37:54.000000000 -0700
+++ lynx2.8.6rel.2/lynx2-8-6/src/makefile.in    2006-09-24 22:47:28.000000000 
-0700
@@ -143,6 +143,9 @@
 LYrcFile$o :           $(top_srcdir)/userdefs.h
 LYLeaks$o :            $(CMN)LYLeaks.h $(CMN)HTString.h
 
+LYIcon$o:
+       windres -i LYIcon.rc -o LYIcon$o -O coff
+
 CHRTR= chrtrans/
 
 TABLES= \
--- lynx2.8.6rel.2/lynx2-8-6/src/LYCurses.c.ori 2006-10-10 16:39:50.000000000 
-0800
+++ lynx2.8.6rel.2/lynx2-8-6/src/LYCurses.c     2006-10-15 13:40:16.000000000 
-0800
@@ -7,6 +7,10 @@
 #endif /* UNIX */
 #endif /* __MINGW32__ */
 
+#ifdef __DJGPP__
+#include <pc.h>
+#endif /* __DJGPP__ */
+
 #include <LYCurses.h>
 #include <LYStyle.h>
 #include <LYUtils.h>
@@ -1432,21 +1436,24 @@
 #endif /* __DJGPP__ */
 
 #if defined(DOSPATH) && !(defined(USE_SLANG) || defined(_WIN_CC))
-#if defined(PDCURSES)
-    endwin();
-#else /* !PDCURSES */
 #ifdef __DJGPP__
     ScreenClear();
-#else /* some flavor of win32?  */
-#ifdef __MINGW32__
+#if defined(PDCURSES)
+    endwin();
+#endif /* PDCURSES */
+#elif defined(__MINGW32__)
+    chtype bb;
+    bb=getbkgd(stdscr);
+    bkgdset(0);
     clear();
-#else
-    clrscr();
-#endif
-#endif /* win32 */
+    refresh();
+    bkgdset(bb);
+#if defined(PDCURSES)
+    endwin();
 #endif /* PDCURSES */
-#else
+#else /* !__DJGPP && !__MINGW32__ */
 
+    clrscr();
     if (LYCursesON == TRUE) {
        lynx_nl2crlf(TRUE);
        lynx_enable_mouse(0);
@@ -1463,7 +1470,7 @@
        }
 #endif
     }
-
+#endif /* __DJGPP__ */
     fflush(stdout);
 #endif /* defined(DOSPATH) && !(defined(USE_SLANG) || defined(_WIN_CC)) */
     fflush(stderr);
--- lynx2.8.6rel.2/lynx2-8-6/src/LYMain.c.ori   2006-09-18 17:28:28.000000000 
-0800
+++ lynx2.8.6rel.2/lynx2-8-6/src/LYMain.c       2006-10-15 00:11:20.000000000 
-0800
@@ -240,9 +240,17 @@
 BOOLEAN no_bookmark = FALSE;
 BOOLEAN no_bookmark_exec = FALSE;
 BOOLEAN no_chdir = FALSE;
+#ifdef LYNX_CRIPPLED
+BOOLEAN no_disk_save = TRUE;
+#else
 BOOLEAN no_disk_save = FALSE;
+#endif /* LYNX_CRIPPLED */
 BOOLEAN no_dotfiles = NO_DOT_FILES;
+#ifdef LYNX_CRIPPLED
+BOOLEAN no_download = TRUE;
+#else
 BOOLEAN no_download = FALSE;
+#endif /* LYNX_CRIPPLED */
 BOOLEAN no_editor = FALSE;
 BOOLEAN no_exec = FALSE;
 BOOLEAN no_file_url = FALSE;
--- lynx2.8.6rel.2/lynx2-8-6/src/LYMainLoop.c.ori       2006-09-10 
16:38:40.000000000 -0800
+++ lynx2.8.6rel.2/lynx2-8-6/src/LYMainLoop.c   2006-10-15 00:48:18.000000000 
-0800
@@ -1998,6 +1998,10 @@
                               int *old_c,
                               int real_c)
 {
+#ifdef LYNX_CRIPPLED
+    HTUserMsg(DOWNLOAD_DISABLED);
+    return 0;
+#endif /* LYNX_CRIPPLED */
 
     /*
      * Don't do if both download and disk_save are restricted.
@@ -4176,7 +4180,7 @@
 {
     if (!no_shell) {
        stop_curses();
-       printf("%s\r\n", SPAWNING_MSG);
+       printf("\r\n%s", SPAWNING_MSG);
 #if defined(__CYGWIN__)
        /* handling "exec $SHELL" does not work if $SHELL is null */
        if (LYGetEnv("SHELL") == NULL) {
--- lynx2.8.6rel.2/lynx2-8-6/LYMessages_en.h.ori        2006-08-31 
16:37:54.000000000 -0700
+++ lynx2.8.6rel.2/lynx2-8-6/LYMessages_en.h    2006-09-24 15:16:02.000000000 
-0700
@@ -222,7 +222,7 @@
 #else
 #ifdef DOSPATH
 #define SPAWNING_MSG \
- gettext("Type EXIT to return to Lynx.\n")
+ gettext("Type EXIT to return to Lynx.\r\n")
 #else /* UNIX */
 #define SPAWNING_MSG \
  gettext("Spawning your default shell.  Use 'exit' to return to Lynx.\n")
--- lynx2.8.6rel.2/lynx2-8-6/src/LYIcon.rc.ori  2006-09-24 22:53:02.000000000 
-0700
+++ lynx2.8.6rel.2/lynx2-8-6/src/LYIcon.rc      2006-07-16 13:44:56.000000000 
-0700
@@ -0,0 +1 @@
+100    ICON    "./lynx.ico"
--- lynx2.8.6rel.2/lynx2-8-6/src/LYUtils.c.ori  2006-10-02 12:56:54.000000000 
-0800
+++ lynx2.8.6rel.2/lynx2-8-6/src/LYUtils.c      2006-10-15 00:11:24.000000000 
-0800
@@ -3507,8 +3507,13 @@
     { "bookmark_exec", &no_bookmark_exec,      FALSE },
     { "option_save",   &no_option_save,        FALSE },
     { "print",         &no_print,              CAN_ANONYMOUS_PRINT },
+#ifdef LYNX_CRIPPLED
+    { "download",      &no_download,           TRUE },
+    { "disk_save",     &no_disk_save,          TRUE },
+#else
     { "download",      &no_download,           FALSE },
     { "disk_save",     &no_disk_save,          FALSE },
+#endif /* LYNX_CRIPPLED */
 #if defined(EXEC_LINKS) || defined(EXEC_SCRIPTS)
     { "exec",          &no_exec,               
LOCAL_EXECUTION_LINKS_ALWAYS_OFF_FOR_ANONYMOUS },
 #endif
_______________________________________________
Lynx-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lynx-dev

Reply via email to