Skip to content
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions changelog/next.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ set shell id.
## Bug Fixes

- Fixed volume control breaking with pipewire pro audio mode.
- Fixed escape sequence handling in desktop entries.
18 changes: 12 additions & 6 deletions src/core/desktopentry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,22 @@ QVector<QString> DesktopEntry::parseExecString(const QString& execString) {
currentArgument += '\\';
escape = 0;
}
} else if (escape == 2) {
currentArgument += c;
escape = 0;
} else if (escape != 0) {
if (escape != 2) {
// Technically this is an illegal state, but the spec has a terrible double escape
// rule in strings for no discernable reason. Assuming someone might understandably
// misunderstand it, treat it as a normal escape and log it.
switch (c.unicode()) {
case 's': currentArgument += u' '; break;
case 'n': currentArgument += u'\n'; break;
case 't': currentArgument += u'\t'; break;
case 'r': currentArgument += u'\r'; break;
case '\\': currentArgument += u'\\'; break;
default:
qCWarning(logDesktopEntry).noquote()
<< "Illegal escape sequence in desktop entry exec string:" << execString;
currentArgument += c;
break;
}

currentArgument += c;
escape = 0;
} else if (c == u'"' || c == u'\'') {
parsingString = false;
Expand Down