From 1b93e2f2e8600caefe63bb0e5f6114f7cc2cf956 Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 24 Sep 2007 19:44:28 +0100 Subject: [PATCH] WinGit: the uninstaller now removes .bash_history, too After using the Git Shell at least once, there will be a .bash_history file in the home directory. Do not let this hinder the uninstaller from removing the complete Git directory. Signed-off-by: Johannes Schindelin --- share/WinGit/uninstaller.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/share/WinGit/uninstaller.c b/share/WinGit/uninstaller.c index 86e9a45d..122e8ddd 100644 --- a/share/WinGit/uninstaller.c +++ b/share/WinGit/uninstaller.c @@ -262,7 +262,13 @@ int remove_directory(const char *path) while ((e = readdir(d))) if (!strcmp(e->d_name, ".") || !strcmp(e->d_name, "..")) continue; - else { + else if (!strcmp(e->d_name, ".bash_history")) { + char buffer[1024]; + if (snprintf(buffer, sizeof(buffer), "%s/%s", path, + e->d_name) >= sizeof(buffer) || + unlink(buffer)) + result = 1; + } else { char buffer[1024]; if (snprintf(buffer, sizeof(buffer), "%s/%s", path, e->d_name) >= sizeof(buffer)) -- 2.11.4.GIT