File tree Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Expand file tree Collapse file tree 1 file changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -270,15 +270,22 @@ QVector<QString> DesktopEntry::parseExecString(const QString& execString) {
270270 escape = 0 ;
271271 }
272272 } else if (escape != 0 ) {
273- if (escape != 2 ) {
274- // Technically this is an illegal state, but the spec has a terrible double escape
275- // rule in strings for no discernable reason. Assuming someone might understandably
276- // misunderstand it, treat it as a normal escape and log it.
277- qCWarning (logDesktopEntry).noquote ()
278- << " Illegal escape sequence in desktop entry exec string:" << execString;
273+ if (escape == 2 ) {
274+ currentArgument += c;
275+ } else {
276+ switch (c.unicode ()) {
277+ case ' s' : currentArgument += u' ' ; break ;
278+ case ' n' : currentArgument += u' \n ' ; break ;
279+ case ' t' : currentArgument += u' \t ' ; break ;
280+ case ' r' : currentArgument += u' \r ' ; break ;
281+ case ' \\ ' : currentArgument += u' \\ ' ; break ;
282+ default :
283+ qCWarning (logDesktopEntry).noquote ()
284+ << " Illegal escape sequence in desktop entry exec string:" << execString;
285+ currentArgument += c;
286+ break ;
287+ }
279288 }
280-
281- currentArgument += c;
282289 escape = 0 ;
283290 } else if (c == u' "' || c == u' \' ' ) {
284291 parsingString = false ;
You can’t perform that action at this time.
0 commit comments