File tree 4 files changed +13
-6
lines changed
4 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -29,10 +29,12 @@ static Boolean ingroupset(gidset_t gid) {
29
29
static gidset_t * gidset ;
30
30
static Boolean initialized = FALSE;
31
31
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 ));
34
35
gidset = ealloc (ngroups * sizeof (gidset_t ));
35
- getgroups (ngroups , gidset );
36
+ assert (getgroups (ngroups , gidset ) != -1 );
37
+ initialized = TRUE;
36
38
}
37
39
for (i = 0 ; i < ngroups ; i ++ )
38
40
if (gid == gidset [i ])
Original file line number Diff line number Diff line change @@ -180,7 +180,8 @@ PRIM(here) {
180
180
Ref (List * , cmd , tail );
181
181
#ifdef PIPE_BUF
182
182
if (doclen <= PIPE_BUF ) {
183
- pipe (p );
183
+ if (pipe (p ) == -1 )
184
+ fail ("$&here" , "pipe: %s" , esstrerror (errno ));
184
185
ewrite (p [1 ], doc , doclen );
185
186
} else
186
187
#endif
Original file line number Diff line number Diff line change 89
89
90
90
# https://github.com/wryun/es-shell/issues/199
91
91
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'
92
95
}
93
96
94
97
# These tests are based on notes in the CHANGES file from the pre-git days.
Original file line number Diff line number Diff line change @@ -347,9 +347,10 @@ extern int yylex(YYSTYPE *y) {
347
347
cmd = "%here" ;
348
348
} else
349
349
cmd = "%heredoc" ;
350
- else if (c == '=' )
350
+ else if (c == '=' ) {
351
+ input -> ws = NW ;
351
352
return CALL ;
352
- else
353
+ } else
353
354
cmd = "%open" ;
354
355
goto redirection ;
355
356
case '>' :
You can’t perform that action at this time.
0 commit comments