added a few more test cases
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
4ed8651821
commit
3296b5e545
10
lib/pio.c
10
lib/pio.c
@ -608,12 +608,10 @@ static hawk_pio_pid_t standard_fork_and_exec (hawk_pio_t* pio, int pipes[], para
|
||||
static int set_pipe_nonblock (hawk_pio_t* pio, hawk_pio_hnd_t fd, int enabled)
|
||||
{
|
||||
#if defined(O_NONBLOCK)
|
||||
|
||||
int flag = HAWK_FCNTL (fd, F_GETFL, 0);
|
||||
if (flag >= 0) flag = HAWK_FCNTL(fd, F_SETFL, (enabled? (flag | O_NONBLOCK): (flag & ~O_NONBLOCK)));
|
||||
if (flag <= -1) hawk_gem_seterrnum (pio->gem, HAWK_NULL, hawk_syserr_to_errnum(errno));
|
||||
return flag;
|
||||
|
||||
#else
|
||||
hawk_gem_seterrnum (pio->gem, HAWK_NULL, HAWK_ENOIMPL);
|
||||
return -1;
|
||||
@ -925,7 +923,7 @@ create_process:
|
||||
#endif
|
||||
}
|
||||
|
||||
if (dupcmd == HAWK_NULL) goto oops;
|
||||
if (HAWK_UNLIKELY(!dupcmd)) goto oops;
|
||||
|
||||
apiret = CreateProcess(
|
||||
HAWK_NULL, /* LPCTSTR lpApplicationName */
|
||||
@ -1236,7 +1234,7 @@ create_process:
|
||||
|
||||
mn = hawk_count_oocstr(cmd);
|
||||
cmd_line = hawk_dupucstrarr(pio->gem, strarr HAWK_NULL);
|
||||
if (cmd_line == HAWK_NULL) goto oops;
|
||||
if (HAWK_UNLIKELY(!cmd_line)) goto oops;
|
||||
#else
|
||||
if (flags & HAWK_PIO_BCSTRCMD)
|
||||
{
|
||||
@ -1248,12 +1246,12 @@ create_process:
|
||||
|
||||
mn = hawk_count_bcstr((const hawk_bch_t*)cmd);
|
||||
cmd_line = hawk_dupbcstrarr(pio->gem, mbsarr, HAWK_NULL);
|
||||
if (cmd_line == HAWK_NULL) goto oops;
|
||||
if (HAWK_UNLIKELY(!cmd_line)) goto oops;
|
||||
}
|
||||
else
|
||||
{
|
||||
cmd_line = hawk_gem_duputobcstr(gem, cmd, &mn);
|
||||
if (!cmd_line) goto oops; /* illegal sequence in cmd or out of memory */
|
||||
if (HAWK_UNLIKELY(!cmd_line)) goto oops; /* illegal sequence in cmd or out of memory */
|
||||
}
|
||||
#endif
|
||||
|
||||
|
17
t/e-001.err
17
t/e-001.err
@ -2,7 +2,22 @@ BEGIN {
|
||||
##ERROR: unexpected end of input
|
||||
---
|
||||
|
||||
function abc(x { ##ERROR: comma expected in place of
|
||||
function abc(x { ##ERROR: comma expected in place of '{'
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
function abc (x, ...,) { ##ERROR: right parenthesis expected in place of ','
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
function abc (x, ..., a) { ##ERROR: right parenthesis expected in place of ','
|
||||
}
|
||||
|
||||
---
|
||||
|
||||
function abc (... ...) { ##ERROR: right parenthesis expected in place of '...'
|
||||
}
|
||||
|
||||
---
|
||||
|
Loading…
Reference in New Issue
Block a user