Commit ff0ef58
Win32: don't call GetFileAttributes twice in mingw_lstat()
GetFileAttributes cannot handle paths with trailing dir separator. The
current [l]stat implementation calls GetFileAttributes twice if the path
has trailing slashes (first with the original path passed to [l]stat, and
and a second time with a path copy with trailing '/' removed).
With Unicode conversion, we get the length of the path for free and also
have a (wide char) buffer that can be modified.
Remove trailing directory separators before calling the Win32 API.
Signed-off-by: Karsten Blees <[email protected]>1 parent 62d71ac commit ff0ef58
1 file changed
+12
-36
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
944 | 944 | | |
945 | 945 | | |
946 | 946 | | |
947 | | - | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
948 | 956 | | |
| 957 | + | |
949 | 958 | | |
950 | 959 | | |
951 | 960 | | |
| |||
1006 | 1015 | | |
1007 | 1016 | | |
1008 | 1017 | | |
1009 | | - | |
1010 | | - | |
1011 | | - | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
1016 | | - | |
1017 | | - | |
1018 | | - | |
1019 | | - | |
1020 | | - | |
1021 | | - | |
1022 | | - | |
1023 | | - | |
1024 | | - | |
1025 | | - | |
1026 | | - | |
1027 | | - | |
1028 | | - | |
1029 | | - | |
1030 | | - | |
1031 | | - | |
1032 | | - | |
1033 | | - | |
1034 | | - | |
1035 | | - | |
1036 | | - | |
1037 | | - | |
1038 | | - | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
1042 | 1018 | | |
1043 | 1019 | | |
1044 | 1020 | | |
| |||
1066 | 1042 | | |
1067 | 1043 | | |
1068 | 1044 | | |
1069 | | - | |
| 1045 | + | |
1070 | 1046 | | |
1071 | 1047 | | |
1072 | 1048 | | |
1073 | | - | |
| 1049 | + | |
1074 | 1050 | | |
1075 | 1051 | | |
1076 | 1052 | | |
| |||
0 commit comments