all repos — hex @ 508614d73fd6e93b266fc2bc0a39a34466e2c0ac

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

Handled SIGINT properly.
h3rald h3rald@h3rald.com
Fri, 22 Nov 2024 11:52:12 +0100
commit

508614d73fd6e93b266fc2bc0a39a34466e2c0ac

parent

d740131a75ab965589fe33a2f1ad7ba51fe65edd

1 files changed, 3 insertions(+), 3 deletions(-)

jump to
M hex.chex.c

@@ -27,7 +27,6 @@ int HEX_DEBUG = 0;

char HEX_ERROR[256] = ""; char **HEX_ARGV; int HEX_ARGC = 0; -volatile sig_atomic_t HEX_KEEP_RUNNING = 1; int HEX_ERRORS = 1; char *HEX_NATIVE_SYMBOLS[] = {

@@ -3585,7 +3584,7 @@ char line[1024];

printf("hex v%s. Press Ctrl+C to exit.\n", HEX_VERSION); - while (HEX_KEEP_RUNNING) + while (1) { printf("> "); // Prompt if (fgets(line, sizeof(line), stdin) == NULL)

@@ -3611,7 +3610,8 @@

void hex_handle_sigint(int sig) { (void)sig; // Suppress unused warning - HEX_KEEP_RUNNING = 0; + printf("\n"); + exit(0); } // Process piped input from stdin