Skip to content

Commit 561f58f

Browse files
committed
Merge remote-tracking branch 'upstream/master' into palloc
2 parents 147af90 + cc6937f commit 561f58f

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

access.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@ static Boolean ingroupset(gidset_t gid) {
2929
static gidset_t *gidset;
3030
static Boolean initialized = FALSE;
3131
if (!initialized) {
32-
initialized = TRUE;
33-
ngroups = getgroups(0, gidset);
32+
ngroups = getgroups(0, NULL);
33+
if (ngroups == -1)
34+
fail("$&access", "getgroups: %s", esstrerror(errno));
3435
gidset = ealloc(ngroups * sizeof(gidset_t));
35-
getgroups(ngroups, gidset);
36+
assert(getgroups(ngroups, gidset) != -1);
37+
initialized = TRUE;
3638
}
3739
for (i = 0; i < ngroups; i++)
3840
if (gid == gidset[i])

prim-io.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ PRIM(here) {
180180
Ref(List *, cmd, tail);
181181
#ifdef PIPE_BUF
182182
if (doclen <= PIPE_BUF) {
183-
pipe(p);
183+
if (pipe(p) == -1)
184+
fail("$&here", "pipe: %s", esstrerror(errno));
184185
ewrite(p[1], doc, doclen);
185186
} else
186187
#endif

test/tests/regression.es

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ EOF
8989
9090
# https://github.com/wryun/es-shell/issues/199
9191
assert {~ `` \n {echo 'fn-%write-history = $&collect'^\n^'cat << eof' | $es -i >[2=1]} *'incomplete here document'*}
92+
93+
# https://github.com/wryun/es-shell/issues/206
94+
assert {~ `` \n {$es -c 'let (a=<=true) echo $a'} <=true} 'concatenated assignment+call syntax works'
9295
}
9396
9497
# These tests are based on notes in the CHANGES file from the pre-git days.

token.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,9 +347,10 @@ extern int yylex(YYSTYPE *y) {
347347
cmd = "%here";
348348
} else
349349
cmd = "%heredoc";
350-
else if (c == '=')
350+
else if (c == '=') {
351+
input->ws = NW;
351352
return CALL;
352-
else
353+
} else
353354
cmd = "%open";
354355
goto redirection;
355356
case '>':

0 commit comments

Comments
 (0)