gdesktopappinfo: Fix validation of XDG_CURRENT_DESKTOP

Split out XDG_CURRENT_DESKTOP handling to a separate function and make
sure that it drops all the invalid entries properly. Earlier a bad
entry could slip through the checks by sitting just after another bad
entry, like in env being set to `invalid1!:invalid2!`, where
`invalid2!` could slip the checks.
This commit is contained in:
Krzesimir Nowak
2021-01-09 15:29:03 +01:00
parent 46097e9b8e
commit cdf0a50c69
3 changed files with 45 additions and 44 deletions

View File

@@ -0,0 +1,5 @@
[Desktop Entry]
Type=Application
Name=appinfo-test
OnlyShowIn=../invalid/desktop;GNOME
NotShowIn=ROX;