aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2021-05-25 16:24:58 +0200
committerCorinna Vinschen <corinna@vinschen.de>2021-05-25 16:31:26 +0200
commit15c96f2b2660d7a7776c61c9dc78d64262918955 (patch)
tree738ea9c4053b0079fa6431168ce2c996435f2d97 /winsup/cygwin/path.cc
parent4ea7c12a20b405e543f947623081696299844e38 (diff)
downloadnewlib-15c96f2b2660d7a7776c61c9dc78d64262918955.zip
newlib-15c96f2b2660d7a7776c61c9dc78d64262918955.tar.gz
newlib-15c96f2b2660d7a7776c61c9dc78d64262918955.tar.bz2
Cygwin: get_nt_native_path: allow to append suffix
POSIX message queues will be moved into NTFS streams. Extend get_nt_native_path to provide a filename suffix which is not subject to special character transposition, to allow specifying a colon. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index b8850a1..2b48013 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -502,8 +502,10 @@ path_conv::set_nt_native_path (PUNICODE_STRING new_path)
uni_path.Buffer = wide_path;
}
+/* If suffix is not NULL, append the suffix string verbatim.
+ This is used by fhandler_mqueue::mq_open to append an NTFS stream suffix. */
PUNICODE_STRING
-path_conv::get_nt_native_path ()
+path_conv::get_nt_native_path (PUNICODE_STRING suffix)
{
PUNICODE_STRING res;
if (wide_path)
@@ -514,9 +516,13 @@ path_conv::get_nt_native_path ()
{
uni_path.Length = 0;
uni_path.MaximumLength = (strlen (path) + 10) * sizeof (WCHAR);
+ if (suffix)
+ uni_path.MaximumLength += suffix->Length;
wide_path = (PWCHAR) cmalloc_abort (HEAP_STR, uni_path.MaximumLength);
uni_path.Buffer = wide_path;
::get_nt_native_path (path, uni_path, has_dos_filenames_only ());
+ if (suffix)
+ RtlAppendUnicodeStringToString (&uni_path, suffix);
res = &uni_path;
}
return res;