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 /win32 | |
| 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
Diffstat (limited to 'win32')
| -rw-r--r-- | win32/win32.c | 49 |
1 files changed, 20 insertions, 29 deletions
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: |
