patch-lex_c 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. $OpenBSD: patch-lex_c,v 1.7 2017/05/12 20:27:25 naddy Exp $
  2. Index: lex.c
  3. --- lex.c.orig
  4. +++ lex.c
  5. @@ -34,6 +34,8 @@
  6. #include <signal.h>
  7. #include <setjmp.h>
  8. #include <ctype.h>
  9. +#include <unistd.h>
  10. +#include <math.h>
  11. #include "sc.h"
  12. #ifdef NONOTIMEOUT
  13. @@ -107,7 +109,7 @@ int
  14. yylex()
  15. {
  16. char *p = line + linelim;
  17. - int ret;
  18. + int ret = 0;
  19. static int isfunc = 0;
  20. static bool isgoto = 0;
  21. static bool colstate = 0;
  22. @@ -326,7 +328,7 @@ plugin_exists(char *name, int len, char *path)
  23. strcpy((char *)path, HomeDir);
  24. strcat((char *)path, "/.sc/plugins/");
  25. strncat((char *)path, name, len);
  26. - if (fp = fopen((char *)path, "r")) {
  27. + if ((fp = fopen((char *)path, "r"))) {
  28. fclose(fp);
  29. return 1;
  30. }
  31. @@ -334,7 +336,7 @@ plugin_exists(char *name, int len, char *path)
  32. strcpy((char *)path, LIBDIR);
  33. strcat((char *)path, "/plugins/");
  34. strncat((char *)path, name, len);
  35. - if (fp = fopen((char *)path, "r")) {
  36. + if ((fp = fopen((char *)path, "r"))) {
  37. fclose(fp);
  38. return 1;
  39. }
  40. @@ -642,7 +644,7 @@ nmgetch()
  41. #endif
  42. -#if defined(SYSV2) || defined(SYSV3) || defined(MSDOS)
  43. +#if defined(SYSV2) || defined(SYSV3) || defined(MSDOS) || defined(NCURSES_VERSION)
  44. void
  45. initkbd()