If the configuration of the extension is missing - there is no value
Software\Git-Cheetah\PathToMsys in either HKEY_LOCAL_MACHINE or
HKEY_CURRENT_USER - don't try to add or to handle any menu items.
---
If we ever become more verbose about problems, encountered during
preparation or handling of our menu items, this patch prevents us from
overwhelming the user with multiple error dialogs.

 Makefile |    2 +-
 ext.c    |    5 +++++
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/Makefile b/Makefile
index bfc2bc6..6e27640 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ $(TARGET): $(OBJECTS) git_shell_ext.def
 #      dlltool -d git_shell_ext.def -l $@ $(OBJECTS)

 dll.o: dll.h ext.h factory.h systeminfo.h registry.h
-ext.o: ext.h debug.h
+ext.o: ext.h debug.h systeminfo.h
 factory.o: factory.h ext.h menu.h
 menu.o: menu.h ext.h debug.h systeminfo.h exec.h
 systeminfo.o: systeminfo.h
diff --git a/ext.c b/ext.c
index cf85ae8..69777d3 100644
--- a/ext.c
+++ b/ext.c
@@ -3,6 +3,7 @@
 #include <tchar.h>
 #include "ext.h"
 #include "debug.h"
+#include "systeminfo.h"

 DWORD object_count = 0;
 DWORD lock_count = 0;
@@ -57,6 +58,10 @@ inline STDMETHODIMP initialize_git_data(struct
git_data *this_,
        UINT count;
        HRESULT result = S_OK;

+       /* if we can't find msysPath, don't even try to do anything else */
+       if (!msys_path())
+               return E_NOTIMPL;
+
        /* store the folder, if provided */
        if (folder)
                SHGetPathFromIDList(folder, this_->name);
-- 
1.5.4.rc0.929.g50e2

Reply via email to