私はDRBDソフトウェア(user/drbdtool_common.c)ケース内に3つの点(ケース '0' ... '9' :)が有効なC言語スイッチの構文ですか?
const char* shell_escape(const char* s)
{
/* ugly static buffer. so what. */
static char buffer[1024];
char *c = buffer;
if (s == NULL)
return s;
while (*s) {
if (buffer + sizeof(buffer) < c+2)
break;
switch(*s) {
/* set of 'clean' characters */
case '%': case '+': case '-': case '.': case '/':
case '0' ... '9':
case ':': case '=': case '@':
case 'A' ... 'Z':
case '_':
case 'a' ... 'z':
break;
/* escape everything else */
default:
*c++ = '\\';
}
*c++ = *s++;
}
*c = '\0';
return buffer;
}
のためのオープンソースコードファイルでこれを気づいた私は前にCで、この「トリプルドット」の建設(case '0' ... '9':
)を見たことがありません。これは有効な標準C言語ですか?それともプリプロセッサの魔法のようなものですか?何が起きてる?
[Dプログラミング言語](http://www.d-programming-language.org/statement)に標準で関心があります.html#SwitchStatement) –
これはFWIWでもサポートされています。 –