diff --git a/ChangeLog b/ChangeLog index 91283f5f0d..5acda49d1c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Thu Aug 12 10:54:17 2004 NAKAMURA Usaku + + * rubyio.h (rb_eof_error): should mark as NORETURN. + + * win32/win32.c (make_cmdvector): adjust escaped successive + double-quote handling. + Thu Aug 12 01:53:10 2004 Tanaka Akira * io.c (read_buffered_data): extracted from rb_io_fread. diff --git a/rubyio.h b/rubyio.h index fe6c719100..784d7bcb41 100644 --- a/rubyio.h +++ b/rubyio.h @@ -72,7 +72,7 @@ int rb_io_wait_readable _((int)); int rb_io_wait_writable _((int)); VALUE rb_io_taint_check _((VALUE)); -void rb_eof_error _((void)); +NORETURN(void rb_eof_error _((void))); void rb_read_check _((FILE*)); int rb_read_pending _((FILE*)); diff --git a/win32/win32.c b/win32/win32.c index 95ee05566a..fa91366703 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -1165,11 +1165,12 @@ make_cmdvector(const char *cmd, char ***vec) if (!quote) quote = *ptr; else if (quote == *ptr) { - if (quote == '"' && ptr[1] == '"') ptr++; + if (quote == '"' && quote == ptr[1]) + ptr++; quote = '\0'; } - escape++; } + escape++; slashes = 0; break; @@ -1207,37 +1208,27 @@ make_cmdvector(const char *cmd, char ***vec) case '\'': case '"': + if (!(slashes & 1) && quote && quote != c) { + p++; + slashes = 0; + break; + } + memcpy(p - ((slashes + 1) >> 1), p + (~slashes & 1), + base + len - p); + len -= ((slashes + 1) >> 1) + (~slashes & 1); + p -= (slashes + 1) >> 1; if (!(slashes & 1)) { - if (!quote) { - quote = c; - c = '\0'; - } - else if (quote == c) { + if (quote) { + if (quote == '"' && quote == *p) + p++; quote = '\0'; } - else { - p++; - slashes = 0; - break; - } - } - if (base + slashes == p) { - base += slashes >> 1; - len -= slashes >> 1; - slashes &= 1; - } - if (base == p) { - base = ++p; - --len; - } - else { - memcpy(p - ((slashes + 1) >> 1), p + (~slashes & 1), base + len - p); - slashes >>= 1; - p -= slashes; - len -= slashes + 1; - slashes = 0; - if (c == '"' && *p == c) p++; + else + quote = c; } + else + p++; + slashes = 0; break; default: