Merge branch 'master' into 2-8
This commit is contained in:
@ -230,7 +230,7 @@ static void regsubst(const StreamFormat& fmt, StreamBuffer& buffer, size_t start
|
|||||||
}
|
}
|
||||||
buffer.replace(start+c+ovector[0], l, s);
|
buffer.replace(start+c+ovector[0], l, s);
|
||||||
length += s.length() - l;
|
length += s.length() - l;
|
||||||
c += s.length();
|
c += ovector[0] + s.length();
|
||||||
if (n == fmt.prec) // max match reached
|
if (n == fmt.prec) // max match reached
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -512,7 +512,16 @@ Each time newline is read, line is incremented.
|
|||||||
buffer(token));
|
buffer(token));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (c == '$' && buffer[-1] == '\\')
|
buffer.append(c);
|
||||||
|
if (c == quote)
|
||||||
|
{
|
||||||
|
quote = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (c == '\\')
|
||||||
|
{
|
||||||
|
c = getc(file);
|
||||||
|
if (c == '$')
|
||||||
{
|
{
|
||||||
// quoted variable reference
|
// quoted variable reference
|
||||||
// terminate string here and do variable in next pass
|
// terminate string here and do variable in next pass
|
||||||
@ -520,11 +529,13 @@ Each time newline is read, line is incremented.
|
|||||||
ungetc(c, file);
|
ungetc(c, file);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
buffer.append(c);
|
if (c == EOF || c == '\n')
|
||||||
if (c == quote && buffer[-2] != '\\')
|
|
||||||
{
|
{
|
||||||
quote = false;
|
error(line, filename(), "Backslash at end of line: %s\n",
|
||||||
break;
|
buffer(token));
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
buffer.append(c);
|
||||||
}
|
}
|
||||||
c = getc(file);
|
c = getc(file);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user