diff options
| author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-08-12 01:56:25 +0000 |
|---|---|---|
| committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-08-12 01:56:25 +0000 |
| commit | c9f48bdbaa11ef65ab9cd490ef3f46c7a771e719 (patch) | |
| tree | 9e91176b5ad730eb5b6cb52b00c677c455e57faa | |
| parent | fc1b138eb284c9957cbf3ebe7a71ee4c50a8f7cd (diff) | |
| download | ruby-c9f48bdbaa11ef65ab9cd490ef3f46c7a771e719.tar.gz ruby-c9f48bdbaa11ef65ab9cd490ef3f46c7a771e719.tar.xz ruby-c9f48bdbaa11ef65ab9cd490ef3f46c7a771e719.zip | |
* rubyio.h (rb_eof_error): should mark as NORETURN.
* win32/win32.c (make_cmdvector): adjust escaped successive
double-quote handling.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@6758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 7 | ||||
| -rw-r--r-- | rubyio.h | 2 | ||||
| -rw-r--r-- | win32/win32.c | 49 |
3 files changed, 28 insertions, 30 deletions
@@ -1,3 +1,10 @@ +Thu Aug 12 10:54:17 2004 NAKAMURA Usaku <usa@ruby-lang.org> + + * 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 <akr@m17n.org> * io.c (read_buffered_data): extracted from rb_io_fread. @@ -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 95ee05566..fa9136670 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: |
