Skip to content

Commit dd99b0e

Browse files
authored
Merge pull request #1006 from bloomberg/regression_path_fix
fix: regression windows path slash
2 parents 897a499 + 984f26f commit dd99b0e

14 files changed

+52
-50
lines changed

jscomp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ world:
380380
travis-world-test:
381381
$(MAKE) world
382382
@echo "Making test"
383-
make test
383+
$(NATIVE) -g -I bin -w -a unix.cmxa stubs/ext_basic_hash_stubs.c bin/all_ounit_tests.mli bin/all_ounit_tests.ml -o bin/all_ounit_tests.exe && bin/all_ounit_tests.exe
384384
$(MAKE) -C test all
385385
@echo "Making test finsihed"
386386

jscomp/bin/.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
ppx_metaquot
2-
bspack.exe
3-
bsc.exe
4-
!*.d

jscomp/bin/all_ounit_tests.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6769,7 +6769,7 @@ val replace_backward_slash : string -> string
67696769
(*
67706770
[no_slash s i len]
67716771
*)
6772-
val no_slash : string -> int -> int -> bool
6772+
val no_char : string -> char -> int -> int -> bool
67736773
(** if no conversion happens, reference equality holds *)
67746774
val replace_slash_backward : string -> string
67756775

@@ -6986,13 +6986,13 @@ let find_package_json_dir cwd =
69866986
let package_dir = lazy (find_package_json_dir (Lazy.force cwd))
69876987

69886988

6989-
let rec no_slash x i len =
6989+
let rec no_char x ch i len =
69906990
i >= len ||
6991-
(String.unsafe_get x i <> '/' && no_slash x (i + 1) len)
6991+
(String.unsafe_get x i <> ch && no_char x ch (i + 1) len)
69926992

69936993
let replace_backward_slash (x : string)=
69946994
let len = String.length x in
6995-
if no_slash x 0 len then x
6995+
if no_char x '\\' 0 len then x
69966996
else
69976997
String.map (function
69986998
|'\\'-> '/'
@@ -7001,7 +7001,7 @@ let replace_backward_slash (x : string)=
70017001

70027002
let replace_slash_backward (x : string ) =
70037003
let len = String.length x in
7004-
if no_slash x 0 len then x
7004+
if no_char x '/' 0 len then x
70057005
else
70067006
String.map (function
70077007
| '/' -> '\\'

jscomp/bin/bsb.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ val replace_backward_slash : string -> string
10301030
(*
10311031
[no_slash s i len]
10321032
*)
1033-
val no_slash : string -> int -> int -> bool
1033+
val no_char : string -> char -> int -> int -> bool
10341034
(** if no conversion happens, reference equality holds *)
10351035
val replace_slash_backward : string -> string
10361036

@@ -1247,13 +1247,13 @@ let find_package_json_dir cwd =
12471247
let package_dir = lazy (find_package_json_dir (Lazy.force cwd))
12481248

12491249

1250-
let rec no_slash x i len =
1250+
let rec no_char x ch i len =
12511251
i >= len ||
1252-
(String.unsafe_get x i <> '/' && no_slash x (i + 1) len)
1252+
(String.unsafe_get x i <> ch && no_char x ch (i + 1) len)
12531253

12541254
let replace_backward_slash (x : string)=
12551255
let len = String.length x in
1256-
if no_slash x 0 len then x
1256+
if no_char x '\\' 0 len then x
12571257
else
12581258
String.map (function
12591259
|'\\'-> '/'
@@ -1262,7 +1262,7 @@ let replace_backward_slash (x : string)=
12621262

12631263
let replace_slash_backward (x : string ) =
12641264
let len = String.length x in
1265-
if no_slash x 0 len then x
1265+
if no_char x '/' 0 len then x
12661266
else
12671267
String.map (function
12681268
| '/' -> '\\'
@@ -6284,7 +6284,7 @@ let (//) = Ext_filename.combine
62846284
*)
62856285
let resolve_bsb_magic_file ~cwd ~desc p =
62866286
let p_len = String.length p in
6287-
let no_slash = Ext_filename.no_slash p 0 p_len in
6287+
let no_slash = Ext_filename.no_char p '/' 0 p_len in
62886288
if no_slash then
62896289
p
62906290
else if Filename.is_relative p &&

jscomp/bin/bsb_helper.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ val replace_backward_slash : string -> string
996996
(*
997997
[no_slash s i len]
998998
*)
999-
val no_slash : string -> int -> int -> bool
999+
val no_char : string -> char -> int -> int -> bool
10001000
(** if no conversion happens, reference equality holds *)
10011001
val replace_slash_backward : string -> string
10021002

@@ -1213,13 +1213,13 @@ let find_package_json_dir cwd =
12131213
let package_dir = lazy (find_package_json_dir (Lazy.force cwd))
12141214

12151215

1216-
let rec no_slash x i len =
1216+
let rec no_char x ch i len =
12171217
i >= len ||
1218-
(String.unsafe_get x i <> '/' && no_slash x (i + 1) len)
1218+
(String.unsafe_get x i <> ch && no_char x ch (i + 1) len)
12191219

12201220
let replace_backward_slash (x : string)=
12211221
let len = String.length x in
1222-
if no_slash x 0 len then x
1222+
if no_char x '\\' 0 len then x
12231223
else
12241224
String.map (function
12251225
|'\\'-> '/'
@@ -1228,7 +1228,7 @@ let replace_backward_slash (x : string)=
12281228

12291229
let replace_slash_backward (x : string ) =
12301230
let len = String.length x in
1231-
if no_slash x 0 len then x
1231+
if no_char x '/' 0 len then x
12321232
else
12331233
String.map (function
12341234
| '/' -> '\\'

jscomp/bin/bsdep.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26064,7 +26064,7 @@ val replace_backward_slash : string -> string
2606426064
(*
2606526065
[no_slash s i len]
2606626066
*)
26067-
val no_slash : string -> int -> int -> bool
26067+
val no_char : string -> char -> int -> int -> bool
2606826068
(** if no conversion happens, reference equality holds *)
2606926069
val replace_slash_backward : string -> string
2607026070

@@ -26281,13 +26281,13 @@ let find_package_json_dir cwd =
2628126281
let package_dir = lazy (find_package_json_dir (Lazy.force cwd))
2628226282

2628326283

26284-
let rec no_slash x i len =
26284+
let rec no_char x ch i len =
2628526285
i >= len ||
26286-
(String.unsafe_get x i <> '/' && no_slash x (i + 1) len)
26286+
(String.unsafe_get x i <> ch && no_char x ch (i + 1) len)
2628726287

2628826288
let replace_backward_slash (x : string)=
2628926289
let len = String.length x in
26290-
if no_slash x 0 len then x
26290+
if no_char x '\\' 0 len then x
2629126291
else
2629226292
String.map (function
2629326293
|'\\'-> '/'
@@ -26296,7 +26296,7 @@ let replace_backward_slash (x : string)=
2629626296

2629726297
let replace_slash_backward (x : string ) =
2629826298
let len = String.length x in
26299-
if no_slash x 0 len then x
26299+
if no_char x '/' 0 len then x
2630026300
else
2630126301
String.map (function
2630226302
| '/' -> '\\'

jscomp/bin/bsppx.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7931,7 +7931,7 @@ val replace_backward_slash : string -> string
79317931
(*
79327932
[no_slash s i len]
79337933
*)
7934-
val no_slash : string -> int -> int -> bool
7934+
val no_char : string -> char -> int -> int -> bool
79357935
(** if no conversion happens, reference equality holds *)
79367936
val replace_slash_backward : string -> string
79377937

@@ -8148,13 +8148,13 @@ let find_package_json_dir cwd =
81488148
let package_dir = lazy (find_package_json_dir (Lazy.force cwd))
81498149

81508150

8151-
let rec no_slash x i len =
8151+
let rec no_char x ch i len =
81528152
i >= len ||
8153-
(String.unsafe_get x i <> '/' && no_slash x (i + 1) len)
8153+
(String.unsafe_get x i <> ch && no_char x ch (i + 1) len)
81548154

81558155
let replace_backward_slash (x : string)=
81568156
let len = String.length x in
8157-
if no_slash x 0 len then x
8157+
if no_char x '\\' 0 len then x
81588158
else
81598159
String.map (function
81608160
|'\\'-> '/'
@@ -8163,7 +8163,7 @@ let replace_backward_slash (x : string)=
81638163

81648164
let replace_slash_backward (x : string ) =
81658165
let len = String.length x in
8166-
if no_slash x 0 len then x
8166+
if no_char x '/' 0 len then x
81678167
else
81688168
String.map (function
81698169
| '/' -> '\\'

jscomp/bin/config_whole_compiler.mlp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
(* The main OCaml version string has moved to ../VERSION *)
2424
let version = "4.02.3+BS"
2525

26-
let standard_library_default = "%%LIBDIR%%"
26+
let standard_library_default = %%LIBDIR%%
2727

2828
let standard_library =
2929
try

jscomp/bin/whole_compiler.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21426,7 +21426,7 @@ val replace_backward_slash : string -> string
2142621426
(*
2142721427
[no_slash s i len]
2142821428
*)
21429-
val no_slash : string -> int -> int -> bool
21429+
val no_char : string -> char -> int -> int -> bool
2143021430
(** if no conversion happens, reference equality holds *)
2143121431
val replace_slash_backward : string -> string
2143221432

@@ -21643,13 +21643,13 @@ let find_package_json_dir cwd =
2164321643
let package_dir = lazy (find_package_json_dir (Lazy.force cwd))
2164421644

2164521645

21646-
let rec no_slash x i len =
21646+
let rec no_char x ch i len =
2164721647
i >= len ||
21648-
(String.unsafe_get x i <> '/' && no_slash x (i + 1) len)
21648+
(String.unsafe_get x i <> ch && no_char x ch (i + 1) len)
2164921649

2165021650
let replace_backward_slash (x : string)=
2165121651
let len = String.length x in
21652-
if no_slash x 0 len then x
21652+
if no_char x '\\' 0 len then x
2165321653
else
2165421654
String.map (function
2165521655
|'\\'-> '/'
@@ -21658,7 +21658,7 @@ let replace_backward_slash (x : string)=
2165821658

2165921659
let replace_slash_backward (x : string ) =
2166021660
let len = String.length x in
21661-
if no_slash x 0 len then x
21661+
if no_char x '/' 0 len then x
2166221662
else
2166321663
String.map (function
2166421664
| '/' -> '\\'

jscomp/bsb/bsb_default.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ let (//) = Ext_filename.combine
3636
*)
3737
let resolve_bsb_magic_file ~cwd ~desc p =
3838
let p_len = String.length p in
39-
let no_slash = Ext_filename.no_slash p 0 p_len in
39+
let no_slash = Ext_filename.no_char p '/' 0 p_len in
4040
if no_slash then
4141
p
4242
else if Filename.is_relative p &&

0 commit comments

Comments
 (0)