8000 libmount: Check the quotation only if it comes after the '='. by echoechoin · Pull Request #3540 · util-linux/util-linux · GitHub
[go: up one dir, main page]

Skip to content

libmount: Check the quotation only if it comes after the '='. #3540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions lib/strutils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1235,8 +1235,14 @@ int ul_optstr_next(char **optstr, char **name, size_t *namesz,
return -EINVAL;
if (!start)
start = p; /* beginning of the option item */
if (*p == '"')
open_quote ^= 1; /* reverse the status */
if (*p == '"') {
if (p > optstr0 && *(p - 1) == '=' && !open_quote) {
open_quote ^= 1;
} else if (open_quote) {
open_quote ^= 1;
}
continue;
}
if (open_quote)
continue; /* still in quoted block */
if (!sep && p > start && *p == '=')
Expand Down
Loading
0