You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.2 KiB

  1. From 95c99f69e026e8c57aecba545e51c97f3b284e75 Mon Sep 17 00:00:00 2001
  2. From: "Gary E. Miller" <gem@rellim.com>
  3. Date: Tue, 23 Jun 2015 14:36:26 -0700
  4. Subject: [PATCH] Remove a BSD-ism.
  5. CTRL('L') is a BSD-ism. CTRL() is defined in sys/ttydefaults.h
  6. which does not always exist. Instead of adding scons tests for
  7. needing CTRL() and its include files just replace with a simple
  8. constant.
  9. Needed for musl and found by Baruch Siach <baruch@tkos.co.il>
  10. ---
  11. gpsmon.c | 6 +++++-
  12. 1 file changed, 5 insertions(+), 1 deletion(-)
  13. diff --git a/gpsmon.c b/gpsmon.c
  14. index c3001c8..58c8300 100644
  15. --- a/gpsmon.c
  16. +++ b/gpsmon.c
  17. @@ -583,6 +583,9 @@ static void select_packet_monitor(struct gps_device_t *device)
  18. (void)wnoutrefresh(devicewin);
  19. }
  20. +/* Control-L character */
  21. +#define CTRL_L 0x0C
  22. +
  23. static char *curses_get_command(void)
  24. /* char-by-char nonblocking input, return accumulated command line on \n */
  25. {
  26. @@ -591,7 +594,8 @@ static char *curses_get_command(void)
  27. int c;
  28. c = wgetch(cmdwin);
  29. - if (c == CTRL('L')) {
  30. + if (CTRL_L == c) {
  31. + /* ^L is to repaint the screen */
  32. (void)clearok(stdscr, true);
  33. if (active != NULL && (*active)->initialize != NULL)
  34. (void)(*active)->initialize();
  35. --
  36. 2.6.0