[syslinux] The simple menu system doesn't reset LF/NL

hiranotaka at zng.info hiranotaka at zng.info
Thu Nov 2 02:38:56 PST 2006


An unified diff:

diff -rc syslinux-3.32-pre6/com32/libutil/ansiline.c
syslinux/com32/libutil/ansiline.c
*** syslinux-3.32-pre6/com32/libutil/ansiline.c	2006-11-02
08:31:04.000000000 +0900
--- syslinux/com32/libutil/ansiline.c	2006-11-02 18:32:52.000000000 +0900
***************
*** 38,53 ****
  #include <unistd.h>
  #include <console.h>

- static void __attribute__((destructor)) console_cleanup(void)
- {
-   /* For the serial console, be nice and clean up */
-   fputs("\033[0m\033[20l", stdout);
- }
-
  void console_ansi_std(void)
  {
    openconsole(&dev_stdcon_r, &dev_ansiserial_w);
-   fputs("\033[0m\033[20h", stdout);
  }

  #else
--- 38,46 ----
***************
*** 64,70 ****

  static void __attribute__((destructor)) console_cleanup(void)
  {
-   fputs("\033[0m\033[20l", stdout);
    tcsetattr(0, TCSANOW, &original_termios_settings);
  }

--- 57,62 ----
***************
*** 84,90 ****
    tio.c_iflag |= IGNCR;
    tio.c_cflag |= ICANON|ECHO;
    tcsetattr(0, TCSANOW, &tio);
-   fputs("\033[0m\033[20h", stdout);
  }

  #endif
--- 76,81 ----
diff -rc syslinux-3.32-pre6/com32/libutil/ansiraw.c
syslinux/com32/libutil/ansiraw.c
*** syslinux-3.32-pre6/com32/libutil/ansiraw.c	2006-11-02
08:31:04.000000000 +0900
--- syslinux/com32/libutil/ansiraw.c	2006-11-02 18:30:49.000000000 +0900
***************
*** 38,53 ****
  #include <unistd.h>
  #include <console.h>

- static void __attribute__((destructor)) console_cleanup(void)
- {
-   /* For the serial console, be nice and clean up */
-   fputs("\033[0m\033[20l", stdout);
- }
-
  void console_ansi_raw(void)
  {
    openconsole(&dev_rawcon_r, &dev_ansiserial_w);
-   fputs("\033[0m\033[20h", stdout);
  }

  #else
--- 38,46 ----
***************
*** 64,70 ****

  static void __attribute__((destructor)) console_cleanup(void)
  {
-   fputs("\033[0m\033[20l", stdout);
    tcsetattr(0, TCSANOW, &original_termios_settings);
  }

--- 57,62 ----
***************
*** 86,92 ****
    tio.c_cc[VMIN]  = 0;
    tio.c_cc[VTIME] = 1;		/* Don't 100% busy-wait in Linux */
    tcsetattr(0, TCSAFLUSH, &tio);
-   fputs("\033[0m\033[20h", stdout);
  }

  #endif
--- 78,83 ----
diff -rc syslinux-3.32-pre6/com32/modules/menu.c syslinux/com32/modules/menu.c
*** syslinux-3.32-pre6/com32/modules/menu.c	2006-11-02 08:31:04.000000000 +0900
--- syslinux/com32/modules/menu.c	2006-11-02 19:13:32.000000000 +0900
***************
*** 20,35 ****
  #include <consoles.h>
  #include "menu.h"

- void console_prepare(void)
- {
-   /* Nothing special to do */
- }
-
- void console_cleanup(void)
- {
-   /* Nothing special to do */
- }
-
  int main(int argc, char *argv[])
  {
    console_ansi_raw();
--- 20,25 ----
diff -rc syslinux-3.32-pre6/com32/modules/menumain.c
syslinux/com32/modules/menumain.c
*** syslinux-3.32-pre6/com32/modules/menumain.c	2006-11-02
08:31:04.000000000 +0900
--- syslinux/com32/modules/menumain.c	2006-11-02 18:42:32.000000000 +0900
***************
*** 840,845 ****
--- 840,856 ----
  #endif
  }

+ void console_prepare(void)
+ {
+   fputs("\033[0m\033[20h\033[25l", stdout);
+ }
+
+ void console_cleanup(void)
+ {
+   /* For the serial console, be nice and clean up */
+   fputs("\033[0m\033[20l", stdout);
+ }
+
  int menu_main(int argc, char *argv[])
  {
    const char *cmdline;
diff -rc syslinux-3.32-pre6/com32/modules/vesamenu.c
syslinux/com32/modules/vesamenu.c
*** syslinux-3.32-pre6/com32/modules/vesamenu.c	2006-11-02
08:31:04.000000000 +0900
--- syslinux/com32/modules/vesamenu.c	2006-11-02 18:45:03.000000000 +0900
***************
*** 23,39 ****
  #include <console.h>
  #include "menu.h"

- void console_prepare(void)
- {
-   fputs("\033[0m\033[20h\033[25l", stdout);
- }
-
- void console_cleanup(void)
- {
-   /* For the serial console, be nice and clean up */
-   fputs("\033[0m\033[20l", stdout);
- }
-
  int vesacon_load_background(const char *);

  int main(int argc, char *argv[])
--- 23,28 ----

2006/11/2, Geert Stappers <stappers at stappers.nl>:
> Op 31-10-2006 om 19:51 schreef hiranotaka at zng.info:
> > Hello,
> >
> > I found another problem in the simple menu system with serial console.
> > The menu system doesn't reset LF/NL which was set in console_ansi_row(),
> > because it never calls the destructor, console_clenup(),
> > and so the LF/NL remains until you run "reset" command in sh on Linux.
>
>
> Hint seen, thanks.
>
>
> Please translate it in an unified diff.
>
>
> Cheers
> Geert Stappers
>
> _______________________________________________
> SYSLINUX mailing list
> Submissions to SYSLINUX at zytor.com
> Unsubscribe or set options at:
> http://www.zytor.com/mailman/listinfo/syslinux
> Please do not send private replies to mailing list traffic.
>
>

--
HIRANO Takahito
hiranotaka%zng.info




More information about the Syslinux mailing list