@@ -92,6 +92,8 @@ module Lwsmd = struct
9292 )
9393end
9494
95+ let is_word_sep = function '(' | ')' | ' ' | '\t' | '.' -> true | _ -> false
96+
9597let match_error_tag (lines : string list ) =
9698 let err_catch_list =
9799 [
@@ -105,8 +107,7 @@ let match_error_tag (lines : string list) =
105107 ]
106108 in
107109 let split_to_words str =
108- let seps = ['(' ; ')' ; ' ' ; '\t' ; '.' ] in
109- Stringext. split_f (fun s -> List. exists (fun sep -> sep = s) seps) str
110+ Astring.String. fields ~empty: false ~is_sep: is_word_sep str
110111 in
111112 let rec has_err lines err_pattern =
112113 match lines with
@@ -133,7 +134,7 @@ let extract_sid_from_group_list group_list =
133134 (fun (_ , v ) ->
134135 let v = Stringext. replace " )" " " v in
135136 let v = Stringext. replace " sid =" " |" v in
136- let vs = Stringext. split_f ( fun c -> c = '|' ) v in
137+ let vs = Astring.String. cuts ~empty: false ~sep: " | " v in
137138 let sid = String. trim (List. nth vs 1 ) in
138139 debug " extract_sid_from_group_list get sid=[%s]" sid ;
139140 sid
@@ -166,7 +167,7 @@ module AuthADlw : Auth_signature.AUTH_MODULE = struct
166167 Locking_helpers.Named_mutex. create " IS_SERVER_AVAILABLE"
167168
168169 let splitlines s =
169- Stringext. split_f ( fun c -> c = '\n' ) (Stringext. replace " #012" " \n " s)
170+ Astring.String. cuts ~empty: false ~sep: " \n " (Stringext. replace " #012" " \n " s)
170171
171172 let pbis_common_with_password (password : string ) (pbis_cmd : string )
172173 (pbis_args : string list ) =
@@ -350,9 +351,7 @@ module AuthADlw : Auth_signature.AUTH_MODULE = struct
350351 ! exited_code
351352 (Stringext. replace " \n " " ;" ! output) ;
352353 let split_to_words s =
353- Stringext. split_f
354- (fun c -> c = '(' || c = ')' || c = '.' || c = ' ' )
355- s
354+ Astring.String. fields ~empty: false ~is_sep: is_word_sep s
356355 in
357356 let revlines =
358357 List. rev
@@ -624,7 +623,7 @@ module AuthADlw : Auth_signature.AUTH_MODULE = struct
624623 (* first, we try to authenticated user against our external user database *)
625624 (* pbis_common will raise an Auth_failure if external authentication fails *)
626625 let domain, user =
627- match Stringext. split_f ( fun c -> c = '\\' ) username with
626+ match Astring.String. cuts ~empty: false ~sep: " \\ " username with
628627 | [domain; user] ->
629628 (domain, user)
630629 | [user] ->
@@ -989,7 +988,8 @@ module AuthADlw : Auth_signature.AUTH_MODULE = struct
989988 | "" ->
990989 []
991990 | disabled_modules_string ->
992- Stringext. split_f (fun c -> c = ',' ) disabled_modules_string
991+ Astring.String. cuts ~empty: false ~sep: " ,"
992+ disabled_modules_string
993993 with Not_found -> []
994994 in
995995 let disabled_module_params =
0 commit comments