lynx-dev
[Top][All Lists]
Advanced

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

lynx-dev LYCurses.c size change cleanup


From: pg
Subject: lynx-dev LYCurses.c size change cleanup
Date: Fri, 22 Sep 2000 17:14:54 -0600 (MDT)

Hello, Lyncei,

Don't Panic!

I believe that changes to LYCurses.c in dev.8 and dev.9 realize the
intent of work left incomplete by AJL and Fote.  (At least I used
some of the same variable names.   This patch deletes that code
which has heretofore been unconditionally IFDEFed away (unless
some user has been rash enough to do "gcc -DNOTDEFINED"), and adds
a polite acknowledgement to the originators.

Mostly harmless.

(BTW, "grep NOTDEFINED" gets hits in 85 lines.)

-- gil
-- 
StorageTek
INFORMATION made POWERFUL
########################################################################
%%% Created Mon Sep  4 09:20:57 MDT 2000 by target lynx.patch. %%%
diff -bru orig/lynx2-8-4/src/LYCurses.c lynx2-8-4/src/LYCurses.c
--- orig/lynx2-8-4/src/LYCurses.c       Fri Sep  1 05:23:46 2000
+++ lynx2-8-4/src/LYCurses.c    Mon Sep  4 08:51:22 2000
@@ -821,6 +821,11 @@
         */
 #if defined(HAVE_NEWTERM) && !defined(NCURSES) && !defined(HAVE_RESIZETERM)
        {
+           /*
+            * Put screen geometry in environment variables used by
+            * XOpen curses before calling newterm().  I believe this
+            * completes work left unfinished by AJL & FM -- gil
+            */
            static char lines_putenv[] = "LINES=abcde",
                        cols_putenv[]  = "COLUMNS=abcde";
            BOOLEAN savesize;
@@ -1185,28 +1190,6 @@
     char *term_putenv = NULL;
     char *buffer = NULL;
     char *cp;
-#if defined(HAVE_SIZECHANGE) && !defined(USE_SLANG) && defined(NOTDEFINED)
-/*
- *  Hack to deal with a problem in sysV curses, that screen can't be
- *  resized to greater than the size used by initscr, which can only
- *  be called once.  So set environment variables LINES and COLUMNS
- *  to some suitably large size to force initscr to allocate enough
- *  space.  Later we get the real window size for setting LYlines
- *  and LYcols. - AJL & FM
- *
- *  Has problems, so we don't use this hack, but the code is here
- *  if someone wants to play with it some more. - FM
- */
-    char *lines_putenv = NULL;
-    char *cols_putenv = NULL;
-
-    if (getenv("LINES") == NULL && getenv("COLUMNS") == NULL) {
-       StrAllocCopy(lines_putenv, "LINES=120");
-       (void) putenv(lines_putenv);
-       StrAllocCopy(cols_putenv, "COLUMNS=240");
-       (void) putenv(cols_putenv);
-    }
-#endif /* HAVE_SIZECHANGE && !USE_SLANG && NOTDEFINED */
 
    /*
     *  If the display was not set by a command line option then
@@ -1270,29 +1253,6 @@
     }
 #endif /* HAVE_TTYTYPE */
 
-#if defined(HAVE_SIZECHANGE) && !defined(USE_SLANG) && defined(NOTDEFINED)
-    if (lines_putenv != NULL) {
-       /*
-        *  Use SIGWINCH handler to set the true window size. - AJL && FM
-        *
-        *  Has problems, so we don't use this hack, but the code is here
-        *  if someone wants to play with it some more. - FM
-        */
-       size_change(0);
-       lines_putenv[6] = '\0';
-       (void) putenv(lines_putenv);
-       cols_putenv[8] = '\0';
-       (void) putenv(cols_putenv);
-       FREE(lines_putenv);
-       FREE(cols_putenv);
-    } else {
-       LYlines = LINES;
-       LYcols = COLS;
-    }
-#else
-    LYlines = LINES;
-    LYcols = COLS;
-#endif /* HAVE_SIZECHANGE && !USE_SLANG && USE_NOTDEFINED */
 #if defined(PDCURSES_EXP) && defined(WIN_EX) && defined(CJK_EX) /* 1999/08/26 
(Thu) 17:53:38 */
     {
        extern int current_codepage;    /* PDCurses lib. */

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

reply via email to

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