From 257cf9f316a2ba0cd68015234bbb196b4d4d30bb Mon Sep 17 00:00:00 2001 From: Kirill Date: Sat, 16 Feb 2008 14:52:08 -0500 Subject: [PATCH] Disable the extension if the configuration is not found 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. Signed-off-by: Johannes Schindelin --- Makefile | 2 +- ext.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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 #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); -- 2.11.4.GIT