Home GnuPG

w32: More changes to the extended length path handling.

Description

w32: More changes to the extended length path handling.

* src/sysutils.c (has_path_separator): New.
(_gpgrt_fname_to_wchar): Rewrite to add the prefix only when needed.
----

GetFullPathNameW has no MAX_PATH limit and thus can be used with any
input. We now prefix the resulting absolute path after the call to
GFPN. This allows to check whether the CWD is an UNC and thus use the
right prefix. We also don't run the entire thing for just a drive
letter etc and further skip the prefix if the absolute path is less
than MAX_PATH. This gives better backward compatibility.

There is also now a GPGRT_DISABLE_EXTLENPATH=-2 which does not disable
the extended path handling but enables debug output. To actually
disable the feature a positive value must be used.

Updates-commit 28ae4ee194ec56e98123d3aceda130161dfd2df8

Details

Provenance
wernerAuthored on Tue, Apr 22, 4:56 PM
Parents
rE1c58363541fc: Mark the initializations with __nonstring__ attribute.
Branches
Unknown
Tags
Unknown
Tasks
T5754: gpgtar needs to support longer filenames.