Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

[PlistBuddy] Ignore empty component in keypath #227

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
4 changes: 3 additions & 1 deletion Libraries/plist/Tools/PlistBuddy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ ParseCommandKeyPathString(std::string const &keyPathString, std::queue<std::stri
bool emptyInitialKey = (prev == 0 && pos == 0);
if (!emptyInitialKey) {
std::string key = keyPathString.substr(prev, end);
keyPath->push(key);
if (key.length()) { // Ignore empty string component
keyPath->push(key);
}
}

prev = (pos == std::string::npos ? pos : pos + 1);
Expand Down