aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWerner Koch <[email protected]>2025-04-24 08:08:01 +0000
committerWerner Koch <[email protected]>2025-04-24 08:08:01 +0000
commitfba44d619d388aa413f4f50756c287a722437475 (patch)
treec4324586437976e6b1883529c62663c47f49c001
parentw32: More changes to the extended length path handling. (diff)
downloadlibgpg-error-fba44d619d388aa413f4f50756c287a722437475.tar.gz
libgpg-error-fba44d619d388aa413f4f50756c287a722437475.zip
w32: Yet another extended length path kludge.
* src/sysutils.c (_gpgrt_fname_to_wchar): Change threshold from 255 to 250. -- Updates-commit: 65114f24e13f835a289f791ed7a5e408b2843d59
-rw-r--r--src/sysutils.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/sysutils.c b/src/sysutils.c
index 5517b3d..b689ff7 100644
--- a/src/sysutils.c
+++ b/src/sysutils.c
@@ -372,8 +372,13 @@ _gpgrt_fname_to_wchar (const char *fname)
xfree (tmpn);
}
- if (res < MAX_PATH - 5)
- ; /* No need for extended length path (-5 is kind of arbitrary) */
+ if (res < 250)
+ {
+ /* No need for extended length path. For unknown reasons
+ * this does not work reliable with 255 or even with the
+ * real value of MAX_PATH (260). A value of 250 seems to
+ * work though. */
+ }
else if (*wname == L'\\' && wname[1] == L'\\' && wname[2])
{
/* For an UNC extended length path only one backslash is
@@ -387,7 +392,6 @@ _gpgrt_fname_to_wchar (const char *fname)
wname[4] = L'U';
wname[5] = L'N';
wname[6] = L'C'; /* (Overwrites the first slash.) */
-
}
else
{