mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-18 00:54:27 -04:00
[parser] fix unwanted removal of lines that don't match a token
* In replace_in_token_data() when looking for lines starting with a specific token but finding lines containing a larger version of the token (e.g. looking for 'linux' but finding 'linux16') we would forget to output the non matching line as we rejected it. * This produced issues such as the one described at: https://ubuntuforums.org/showthread.php?t=2465291&page=10&p=14052629#post14052629 * Fix this by ensuring that we always output the lines that we reject.
This commit is contained in:
parent
deee38d4e5
commit
2761c72187
3 changed files with 9 additions and 7 deletions
|
@ -1187,8 +1187,10 @@ char* replace_in_token_data(const char* filename, const char* token, const char*
|
|||
|
||||
// Skip whitespaces after token (while making sure there's at least one)
|
||||
ns = wcsspn(&buf[i], wspace);
|
||||
if (ns == 0)
|
||||
if (ns == 0) {
|
||||
fputws(buf, fd_out);
|
||||
continue;
|
||||
}
|
||||
i += ns;
|
||||
|
||||
// p[x] = starting position of the fragment with the replaceable string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue