Signed-off-by: Huw Davies huw@codeweavers.com --- dlls/user32/user_main.c | 5 +++-- programs/explorer/desktop.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/user_main.c b/dlls/user32/user_main.c index 9e45835e3a9..6b70db4978c 100644 --- a/dlls/user32/user_main.c +++ b/dlls/user32/user_main.c @@ -196,7 +196,8 @@ static const WCHAR *get_default_desktop(void) len = sizeof(buffer); if (!RegQueryValueExW( appkey, desktopW, 0, NULL, (LPBYTE)buffer, &len )) ret = buffer; RegCloseKey( appkey ); - if (ret) return ret; + if (ret && *ret) return ret; + ret = NULL; } }
@@ -209,7 +210,7 @@ static const WCHAR *get_default_desktop(void) len = sizeof(buffer); if (!RegQueryValueExW( appkey, desktopW, 0, NULL, (LPBYTE)buffer, &len )) ret = buffer; RegCloseKey( appkey ); - if (ret) return ret; + if (ret && *ret) return ret; } return defaultW; } diff --git a/programs/explorer/desktop.c b/programs/explorer/desktop.c index e7acb2db772..691db5c8bda 100644 --- a/programs/explorer/desktop.c +++ b/programs/explorer/desktop.c @@ -732,7 +732,7 @@ static const WCHAR *get_default_desktop_name(void) /* @@ Wine registry key: HKCU\Software\Wine\Explorer */ if (!RegOpenKeyW( HKEY_CURRENT_USER, explorer_keyW, &hkey )) { - if (!RegQueryValueExW( hkey, desktopW, 0, NULL, (LPBYTE)buffer, &size )) ret = buffer; + if (!RegQueryValueExW( hkey, desktopW, 0, NULL, (LPBYTE)buffer, &size ) && *buffer) ret = buffer; RegCloseKey( hkey ); } return ret; @@ -974,7 +974,7 @@ void manage_desktop( WCHAR *arg )
/* parse the desktop option */ /* the option is of the form /desktop=name[,widthxheight[,driver]] */ - if (*arg == '=' || *arg == ',') + if ((arg[0] == '=' || arg[0] == ',') && arg[1] && arg[1] != ',') { arg++; name = arg;