shithub: hx

Download patch

ref: fd724962d1f6d325da44fc2db7425939f8fde79e
parent: eaac0f22ca88dbe40afa83fbfaf36da0c6f7821b
author: Sigrid Haflínudóttir <ftrvxmtrx@gmail.com>
date: Sun Dec 29 08:13:51 EST 2019

don't use printf, it buffers

--- a/hx.c
+++ b/hx.c
@@ -10,7 +10,6 @@
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
-#define print printf
 #define OREAD O_RDONLY
 #define nil NULL
 #define exits(s) do { return (s) != nil; } while (0)
@@ -171,8 +170,11 @@
 			perror(argv[i]);
 			res = 1;
 		} else {
-			if (argc > 2)
-				print("hx %s\n", argv[i]);
+			if (argc > 2) {
+				write(1, "hx ", 3);
+				write(1, argv[i], strlen(argv[i]));
+				write(1, "\n", 1);
+			}
 			if ((res = hx(fd)) != 0)
 				perror(argv[1]);
 			close(fd);