mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* rubyio.h (rb_eof_error): should mark as NORETURN.
* win32/win32.c (make_cmdvector): adjust escaped successive double-quote handling. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
0e104131b8
commit
564538541e
3 changed files with 28 additions and 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>
|
Thu Aug 12 01:53:10 2004 Tanaka Akira <akr@m17n.org>
|
||||||
|
|
||||||
* io.c (read_buffered_data): extracted from rb_io_fread.
|
* io.c (read_buffered_data): extracted from rb_io_fread.
|
||||||
|
|
2
rubyio.h
2
rubyio.h
|
@ -72,7 +72,7 @@ int rb_io_wait_readable _((int));
|
||||||
int rb_io_wait_writable _((int));
|
int rb_io_wait_writable _((int));
|
||||||
|
|
||||||
VALUE rb_io_taint_check _((VALUE));
|
VALUE rb_io_taint_check _((VALUE));
|
||||||
void rb_eof_error _((void));
|
NORETURN(void rb_eof_error _((void)));
|
||||||
|
|
||||||
void rb_read_check _((FILE*));
|
void rb_read_check _((FILE*));
|
||||||
int rb_read_pending _((FILE*));
|
int rb_read_pending _((FILE*));
|
||||||
|
|
|
@ -1165,11 +1165,12 @@ make_cmdvector(const char *cmd, char ***vec)
|
||||||
if (!quote)
|
if (!quote)
|
||||||
quote = *ptr;
|
quote = *ptr;
|
||||||
else if (quote == *ptr) {
|
else if (quote == *ptr) {
|
||||||
if (quote == '"' && ptr[1] == '"') ptr++;
|
if (quote == '"' && quote == ptr[1])
|
||||||
|
ptr++;
|
||||||
quote = '\0';
|
quote = '\0';
|
||||||
}
|
}
|
||||||
escape++;
|
|
||||||
}
|
}
|
||||||
|
escape++;
|
||||||
slashes = 0;
|
slashes = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -1207,37 +1208,27 @@ make_cmdvector(const char *cmd, char ***vec)
|
||||||
|
|
||||||
case '\'':
|
case '\'':
|
||||||
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 (!(slashes & 1)) {
|
||||||
if (!quote) {
|
if (quote) {
|
||||||
quote = c;
|
if (quote == '"' && quote == *p)
|
||||||
c = '\0';
|
p++;
|
||||||
}
|
|
||||||
else if (quote == c) {
|
|
||||||
quote = '\0';
|
quote = '\0';
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
p++;
|
quote = c;
|
||||||
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
|
||||||
|
p++;
|
||||||
|
slashes = 0;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Add table
Reference in a new issue