commit a0759f6

shrub  ·  2026-05-15 17:31:44 +0000 UTC
parent 2536dc6
fix some kati tests
6 files changed,  +12, -13
+2, -2
 1@@ -155,6 +155,8 @@ fnshell(const char *cmd)
 2 	out[len] = 0;
 3 	pclose(fp);
 4 
 5+	while (len > 0 && (out[len - 1] == '\n' || out[len - 1] == '\r'))
 6+		len--;
 7 	for (i = 0, j = 0; i < len; i++) {
 8 		unsigned char ch;
 9 
10@@ -165,8 +167,6 @@ fnshell(const char *cmd)
11 		}
12 		out[j++] = out[i];
13 	}
14-	while (j > 0 && isspace((unsigned char)out[j - 1]))
15-		j--;
16 	out[j] = 0;
17 	return out;
18 }
+2, -2
1@@ -1,5 +1,5 @@
2-foo = $(subst /rkati,,$(subst /kati,,$(subst /make,,$(abspath ./foo bar/../foo bar//..//foo / /usr))))
3-bar = $(subst /rkati,,$(subst /kati,,$(subst /make,,$(abspath .. ./. ./ /aa/.. a///))))
4+foo = $(abspath ./foo bar/../foo bar//..//foo / /usr)
5+bar = $(abspath . ./. ./ /aa/.. a///)
6 
7 test:
8 	echo $(foo)
+1, -2
1@@ -1,3 +1,2 @@
2 test:
3-	# Make and kati will be executed in different subdirs
4-	echo $(dir $(CURDIR))
5+	echo $(CURDIR)/
+5, -5
 1@@ -1,9 +1,9 @@
 2-$(shell touch ../foo)
 3+$(shell touch foo)
 4 
 5-foo = $(realpath ../foo)
 6-bar = $(realpath ../bar)
 7-foofoo = $(realpath ../foo ../foo)
 8-foobar = $(realpath ../foo ../bar)
 9+foo = $(realpath foo)
10+bar = $(realpath bar)
11+foofoo = $(realpath foo foo)
12+foobar = $(realpath foo bar)
13 
14 test:
15 	echo $(foo)
+1, -1
1@@ -1,5 +1,5 @@
2 test:
3-	echo $(shell dirname $$(pwd))
4+	echo $(shell pwd)
5 	echo $(shell false)
6 	echo $(shell  /bin/echo -e "\na \n  b 	\n " )
7 	echo $(shell  /bin/echo -e "\na \n  b 	\n " )X
+1, -1
1@@ -1,4 +1,4 @@
2 # TODO(ninja): $(shell) in another make expression is not supported.
3 
4 test:
5-	echo $(strip $(shell dirname $$(pwd)))
6+	echo $(strip $(shell pwd))