summaryrefslogtreecommitdiff
path: root/src/init.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2010-10-20 15:06:15 +0000
committerWerner Koch <wk@gnupg.org>2010-10-20 15:06:15 +0000
commit960df54ce8d479b42813dc14789cbf9299e207b0 (patch)
treef2857302a3dfa5f0361f5d13b833ebfe7aac76ce /src/init.c
parentd717d13e27cb02fbbb015854e3811d9b0aad3c06 (diff)
downloadlibgpg-error-960df54ce8d479b42813dc14789cbf9299e207b0.tar.gz
Fix for W32CE.
Diffstat (limited to 'src/init.c')
-rw-r--r--src/init.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/init.c b/src/init.c
index f129fd0..9d8c5bf 100644
--- a/src/init.c
+++ b/src/init.c
@@ -235,6 +235,27 @@ get_locale_dir (void)
p = strrchr (result, '\\');
if (p)
*p = 0;
+ /* If we are installed below "bin" strip that part and
+ use the top directory instead.
+
+ Background: Under Windows we don't install GnuPG
+ below bin/ but in the top directory with only share/,
+ lib/, and etc/ below it. One of the reasons is to
+ keep the the length of the filenames at bay so not to
+ increase the limited length of the PATH envvar.
+ Another and more important reason, however, is that
+ the very first GPG versions on W32 were installed
+ into a flat directory structure and for best
+ compatibility with these versions we didn't changed
+ that later. For WindowsCE we can right away install
+ it under bin, though. The hack with detection of the
+ bin directory part allows us to eventually migrate to
+ such a directory layout under plain Windows without
+ the need to change libgpg-error. */
+ p = strrchr (result, '\\');
+ if (p && !strcmp (p+1, "bin"))
+ *p = 0;
+ /* Append the static part. */
strcat (result, SLDIR);
}
}