all repos — hex @ f82506c353ba4adf38f19738e88f5f0284b91c8b

A tiny, minimalist, slightly-esoteric concatenative programming lannguage.

Fixed errors on Linux.
h3rald h3rald@h3rald.com
Mon, 18 Nov 2024 22:48:56 +0000
commit

f82506c353ba4adf38f19738e88f5f0284b91c8b

parent

e5560a7244e79444f230982ff6faa02a2964ce30

1 files changed, 5 insertions(+), 4 deletions(-)

jump to
M hex.chex.c

@@ -3,10 +3,11 @@ #include <stdlib.h>

#include <string.h> #include <ctype.h> #include <signal.h> +#include <stdarg.h> #ifdef _WIN32 #include <windows.h> #include <io.h> -int hex_isatty(int fd) +int isatty(int fd) { HANDLE h = (HANDLE)_get_osfhandle(fd); return (GetFileType(h) == FILE_TYPE_CHAR);

@@ -606,10 +607,10 @@ case HEX_TYPE_STRING:

fprintf(stream, "\"%s\"", element.data.strValue); break; case HEX_TYPE_USER_SYMBOL: - fprintf(stream, element.symbolName); + fprintf(stream, "%s", element.symbolName); break; case HEX_TYPE_NATIVE_SYMBOL: - fprintf(stream, element.symbolName); + fprintf(stream, "%s", element.symbolName); break; case HEX_TYPE_QUOTATION: {

@@ -1790,7 +1791,7 @@ return 0;

} } } - if (!hex_isatty(fileno(stdin))) + if (!isatty(fileno(stdin))) { // Process piped input from stdin hex_process_stdin();