Commit 4eddbb0a authored by Jason Edmeades's avatar Jason Edmeades Committed by Vitaly Lipatov

cmd: ftype failed to clear file associations

If a file association was set (e.g. ftype fred=xxx), ftype fred= needs to clear it, but previously it failed to do so.
parent 65322d2c
......@@ -4901,11 +4901,11 @@ void WCMD_assoc (const WCHAR *args, BOOL assoc) {
/* If nothing after '=' then clear value - only valid for ASSOC */
if (*newValue == 0x00) {
if (assoc) rc = RegDeleteKeyW(key, args);
if (assoc && rc == ERROR_SUCCESS) {
rc = RegDeleteTreeW(key, args);
if (rc == ERROR_SUCCESS) {
WINE_TRACE("HKCR Key '%s' deleted\n", wine_dbgstr_w(args));
} else if (assoc && rc != ERROR_FILE_NOT_FOUND) {
} else if (rc != ERROR_FILE_NOT_FOUND) {
WCMD_print_error();
errorlevel = 2;
......
......@@ -2485,6 +2485,12 @@ echo echo +++>> tmp.cmd
echo ftype footype>> tmp.cmd
cmd /c tmp.cmd
echo --- testing association
ftype footype=cmd.exe /c "echo '%%1'"
echo dummy>test.foo
test.foo
del test.foo
echo --- resetting association
assoc .foo=
......@@ -2516,6 +2522,9 @@ echo .foo=footype
echo footype=foo_opencmd
echo +++
echo footype=foo_opencmd
echo --- testing association
echo footype=cmd.exe /c "echo '%%1'"
echo Skipped as not enough permissions
echo --- resetting association
echo original value
......
......@@ -1469,8 +1469,11 @@ footype=foo_opencmd
footype=foo_opencmd
+++
footype=foo_opencmd
--- testing association
footype=cmd.exe /c "echo '%1'"
'@drive@@path@foobar\test.foo'@or_broken@Skipped as not enough permissions
--- resetting association
@todo_wine@original value@or_broken@buggyXP@or_broken@!WINE_FOO!
original value@or_broken@buggyXP@or_broken@!WINE_FOO!
------------ Testing CALL ------------
--- external script
foo@space@
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment