File tree Expand file tree Collapse file tree 4 files changed +13
-6
lines changed Expand file tree Collapse file tree 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) {
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 ])
Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change 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.
Original file line number Diff line number Diff 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+ w = NW ;
351352 return CALL ;
352- else
353+ } else
353354 cmd = "%open" ;
354355 goto redirection ;
355356 case '>' :
You can’t perform that action at this time.
0 commit comments