OSDN Git Service

BUG: [ 1412237 ] InitOption return value wrong if RegCreateKey fails
authorPerry Rapp <elsapo@users.sourceforge.net>
Wed, 25 Jan 2006 02:36:40 +0000 (02:36 +0000)
committerPerry Rapp <elsapo@users.sourceforge.net>
Wed, 25 Jan 2006 02:36:40 +0000 (02:36 +0000)
  Fix unused wrong return value of InitOption & improve one comment
 Src/Common: OptionsMgr.cpp

Src/Changes.txt
Src/Common/OptionsMgr.cpp

index d7ca86e..28a9bbe 100644 (file)
@@ -1,3 +1,8 @@
+2006-01-25 Perry
+ BUG: [ 1412237 ] InitOption return value wrong if RegCreateKey fails
+  Fix unused wrong return value of InitOption & improve one comment
+ Src/Common: OptionsMgr.cpp
+
 2006-01-24 WinMerge experimental release 2.5.3.1 (cvs)
 
 2006-01-23 Kimmo
index e32949c..2e63084 100644 (file)
@@ -759,7 +759,7 @@ int CRegOptionsMgr::InitOption(CString name, varprop::VariantValue defaultValue)
                REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, &action);
 
        if (retValReg != ERROR_SUCCESS)
-               return OPT_OK;
+               return OPT_ERR;
 
        // Check previous value
        DWORD type = 0;
@@ -771,7 +771,7 @@ int CRegOptionsMgr::InitOption(CString name, varprop::VariantValue defaultValue)
        // Actually save value into our in-memory options table
        int retVal = AddOption(name, defaultValue);
        
-       // Update registry if appropriate
+       // Update registry if successfully saved to in-memory table
        if (retVal == OPT_OK)
        {
                // Value didn't exist. Save default value to registry