diff options
author | Werner Koch <[email protected]> | 2010-10-20 15:06:15 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2010-10-20 15:06:15 +0000 |
commit | 960df54ce8d479b42813dc14789cbf9299e207b0 (patch) | |
tree | f2857302a3dfa5f0361f5d13b833ebfe7aac76ce /src | |
parent | Fix initialization of static libs (diff) | |
download | libgpg-error-960df54ce8d479b42813dc14789cbf9299e207b0.tar.gz libgpg-error-960df54ce8d479b42813dc14789cbf9299e207b0.zip |
Fix for W32CE.
Diffstat (limited to 'src')
-rw-r--r-- | src/err-codes.h.in | 3 | ||||
-rw-r--r-- | src/gpg-error.c | 6 | ||||
-rw-r--r-- | src/init.c | 21 |
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); } } @@ -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); } } |