diff --git a/.gitattributes b/.gitattributes index 9b99d3c03c..df7276c0fd 100644 --- a/.gitattributes +++ b/.gitattributes @@ -13156,6 +13156,7 @@ tests/webtbs/tw23503.pp svneol=native#text/pascal tests/webtbs/tw2351.pp svneol=native#text/plain tests/webtbs/tw23568.pp -text svneol=native#text/plain tests/webtbs/tw2363.pp svneol=native#text/plain +tests/webtbs/tw23725.pp svneol=native#text/pascal tests/webtbs/tw23744.pp svneol=native#text/plain tests/webtbs/tw2377.pp svneol=native#text/plain tests/webtbs/tw2378.pp svneol=native#text/plain diff --git a/rtl/nativent/sysfile.inc b/rtl/nativent/sysfile.inc index d937cbe94f..ca41026e4a 100644 --- a/rtl/nativent/sysfile.inc +++ b/rtl/nativent/sysfile.inc @@ -329,7 +329,7 @@ begin if ((filemode and fmshareExclusive) = fmshareExclusive) then { no sharing } else - if (filemode = fmShareCompat) or ((filemode and fmshareDenyWrite) = fmshareDenyWrite) then + if ((filemode and $F0) = fmShareCompat) or ((filemode and fmshareDenyWrite) = fmshareDenyWrite) then shflags := FILE_SHARE_READ else if ((filemode and fmshareDenyRead) = fmshareDenyRead) then diff --git a/rtl/win/sysfile.inc b/rtl/win/sysfile.inc index 96f569a778..9aa4f16a0e 100644 --- a/rtl/win/sysfile.inc +++ b/rtl/win/sysfile.inc @@ -230,7 +230,7 @@ begin if ((filemode and fmshareExclusive) = fmshareExclusive) then { no sharing } else - if (filemode = fmShareCompat) or ((filemode and fmshareDenyWrite) = fmshareDenyWrite) then + if ((filemode and $f0) = fmShareCompat) or ((filemode and fmshareDenyWrite) = fmshareDenyWrite) then shflags := file_Share_Read else if ((filemode and fmshareDenyRead) = fmshareDenyRead) then diff --git a/tests/webtbs/tw23725.pp b/tests/webtbs/tw23725.pp new file mode 100644 index 0000000000..702936b385 --- /dev/null +++ b/tests/webtbs/tw23725.pp @@ -0,0 +1,13 @@ +var + t,t1, t2: text; + s: string; +begin + assign(t,'tw23725.txt'); + rewrite(t); + writeln(t); + close(t); + assign(t1, 'tw23725.txt'); assign(t2, 'tw23725.txt'); + write('Opening 1... '); reset(t1); writeln('done.'); + write('Opening 2... '); reset(t2); writeln('done.'); + close(t2); close(t1); +end.