master
Daniel Kolesa 2017-03-31 03:34:09 +02:00
parent 6b17c4594f
commit 73d1b142d1
3 changed files with 6 additions and 4 deletions

View File

@ -1066,8 +1066,8 @@ static void compile_cmd(
case '3':
case '4':
if (more && (numargs < MaxArguments)) {
int numrep = *fmt - '0' + 1;
fmt -= numrep;
int numrep = -int(*fmt) + '0' - 1;
fmt = ostd::string_range{&fmt[numrep], &fmt[fmt.size()]};
rep = true;
} else {
while (numargs > MaxArguments) {

View File

@ -75,7 +75,7 @@ cs_int cs_parse_int(ostd::string_range input, ostd::string_range *end) {
++past;
}
done:
if (past.equals_front(input)) {
if (&past[0] == &input[0]) {
p_set_end(orig, end);
} else {
p_set_end(past, end);

View File

@ -451,7 +451,9 @@ static inline void callcommand(
case '3':
case '4':
if (i + 1 < numargs) {
fmt -= *fmt - '0' + 1;
fmt = ostd::string_range{
&fmt[-int(*fmt) + '0' - 1], &fmt[fmt.size()]
};
rep = true;
}
break;