Skip to content

Commit

Permalink
update changelog and improve the is_quoted function
Browse files Browse the repository at this point in the history
Signed-off-by: Nguyen Dinh Phi <[email protected]>
  • Loading branch information
Nguyen Dinh Phi authored and ita93 committed Nov 26, 2024
1 parent cd4ee10 commit ac22037
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Upcoming Release
## Changed
- [[#148](https://github.com/rust-vmm/linux-loader/pull/148)] Fixing kernel commandline parameter validation
- [[#148](https://github.com/rust-vmm/linux-loader/pull/148)] Fixing kernel commandline parameter validation.
This change allows parameter values containing spaces in the middle, provided they are enclosed in quotes. However,
strings with quotes in the middle will no longer be accepted as valid parameter values.

# [v0.13.0]

Expand Down
4 changes: 4 additions & 0 deletions src/cmdline/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ fn valid_str(s: &str) -> Result<()> {
}

fn is_quoted(s: &str) -> bool {
if s.len() < 2 {
return false;
}

if let Some(first_char) = s.chars().next() {
if let Some(last_char) = s.chars().last() {
return first_char == '"' && last_char == '"';
Expand Down

0 comments on commit ac22037

Please sign in to comment.