aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2010-10-20 15:06:15 +0000
committerWerner Koch <[email protected]>2010-10-20 15:06:15 +0000
commit960df54ce8d479b42813dc14789cbf9299e207b0 (patch)
treef2857302a3dfa5f0361f5d13b833ebfe7aac76ce /src
parentFix initialization of static libs (diff)
downloadlibgpg-error-960df54ce8d479b42813dc14789cbf9299e207b0.tar.gz
libgpg-error-960df54ce8d479b42813dc14789cbf9299e207b0.zip
Fix for W32CE.
Diffstat (limited to 'src')
-rw-r--r--src/err-codes.h.in3
-rw-r--r--src/gpg-error.c6
-rw-r--r--src/init.c21
3 files changed, 29 insertions, 1 deletions
diff --git a/src/err-codes.h.in b/src/err-codes.h.in
index 092880c..501c5e2 100644
--- a/src/err-codes.h.in
+++ b/src/err-codes.h.in
@@ -215,8 +215,9 @@
183 GPG_ERR_LIMIT_REACHED Limit reached
184 GPG_ERR_NOT_INITIALIZED Not initialized
185 GPG_ERR_MISSING_ISSUER_CERT Missing issuer certificate
-# 186 to 198 are free to be used.
+# 186 to 197 are free to be used.
+198 GPG_ERR_FULLY_CANCELED Operation fully cancelled
199 GPG_ERR_UNFINISHED Operation not yet finished
200 GPG_ERR_BUFFER_TOO_SHORT Buffer too short
diff --git a/src/gpg-error.c b/src/gpg-error.c
index 4b3c19a..fa868ae 100644
--- a/src/gpg-error.c
+++ b/src/gpg-error.c
@@ -131,6 +131,12 @@ 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. */
+ p = strrchr (result, '\\');
+ if (p && !strcmp (p+1, "bin"))
+ *p = 0;
+ /* Append the static part. */
strcat (result, SLDIR);
}
}
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);
}
}