Skip to content

Commit b167882

Browse files
committed
4.3.2 -- Fix issue where . command fails after +
For example, this would fail: $ echo '{}' |jt foo + . jt: unexpected command
1 parent 1cf178d commit b167882

File tree

5 files changed

+9
-4
lines changed

5 files changed

+9
-4
lines changed

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ all: jt docs
1616
clean:
1717
rm -f jt *.o *.a *.out
1818
rm -rf build
19-
rm test/enron.json
19+
rm -f test/enron.json
2020

2121
%.o: %.c
2222
$(CC) -c $(CFLAGS) -DJT_SHA=\"$(SHA)\" $< -o $@

jt.1

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.\" generated with Ronn/v0.7.3
22
.\" http://github.com/rtomayko/ronn/tree/0.7.3
33
.
4-
.TH "JT" "1" "June 2017" "" "JT MANUAL"
4+
.TH "JT" "1" "July 2017" "" "JT MANUAL"
55
.
66
.SH "NAME"
77
\fBjt\fR \- transform JSON data to tabular format

jt.1.html

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

jt.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define JT_STACKSIZE 256
1212
#endif
1313

14-
#define JT_VERSION "4.3.1"
14+
#define JT_VERSION "4.3.2"
1515

1616
int opt_join = 0;
1717
int opt_iter = 0;
@@ -67,6 +67,11 @@ int run(int wordc, word_t *wordv) {
6767
return cols;
6868
} else {
6969
switch (wordv[0].cmd) {
70+
case '.':
71+
// can only get here if top of stack is null
72+
if (opt_join) return -JT_STACKSIZE;
73+
stack_push(DAT, 0);
74+
break;
7075
case '^':
7176
cols = 1;
7277
stack_push(OUT, stack_head(IDX));

jt.tar.gz

125 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)