diff options
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); } } |