ports/math/sc/patches/patch-lex_c

49 lines
1.2 KiB
Text
Raw Normal View History

2023-08-16 22:26:55 +00:00
Index: lex.c
--- lex.c.orig
+++ lex.c
@@ -34,6 +34,8 @@
#include <signal.h>
#include <setjmp.h>
#include <ctype.h>
+#include <unistd.h>
+#include <math.h>
#include "sc.h"
#ifdef NONOTIMEOUT
@@ -107,7 +109,7 @@ int
yylex()
{
char *p = line + linelim;
- int ret;
+ int ret = 0;
static int isfunc = 0;
static bool isgoto = 0;
static bool colstate = 0;
@@ -326,7 +328,7 @@ plugin_exists(char *name, int len, char *path)
strcpy((char *)path, HomeDir);
strcat((char *)path, "/.sc/plugins/");
strncat((char *)path, name, len);
- if (fp = fopen((char *)path, "r")) {
+ if ((fp = fopen((char *)path, "r"))) {
fclose(fp);
return 1;
}
@@ -334,7 +336,7 @@ plugin_exists(char *name, int len, char *path)
strcpy((char *)path, LIBDIR);
strcat((char *)path, "/plugins/");
strncat((char *)path, name, len);
- if (fp = fopen((char *)path, "r")) {
+ if ((fp = fopen((char *)path, "r"))) {
fclose(fp);
return 1;
}
@@ -642,7 +644,7 @@ nmgetch()
#endif
-#if defined(SYSV2) || defined(SYSV3) || defined(MSDOS)
+#if defined(SYSV2) || defined(SYSV3) || defined(MSDOS) || defined(NCURSES_VERSION)
void
initkbd()