File tree Expand file tree Collapse file tree
xapi-stdext/lib/xapi-stdext-std Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 (name tgroup)
33 (modules tgroup)
44 (public_name tgroup)
5- (libraries unix xapi-log xapi-stdext-unix xapi-stdext-std ))
5+ (libraries astring unix xapi-log xapi-stdext-unix))
66
77(test
88 (name test_tgroup)
Original file line number Diff line number Diff line change @@ -70,8 +70,7 @@ module Group = struct
7070 | _ ->
7171 false
7272
73- let sanitize s =
74- Xapi_stdext_std.Xstringext.String. filter_chars s is_alphanum
73+ let sanitize s = Astring.String. filter is_alphanum s
7574
7675 let make ?user_agent subject_sid =
7776 let user_agent =
Original file line number Diff line number Diff line change @@ -103,22 +103,6 @@ module String = struct
103103 ) else
104104 s
105105
106- let filter_chars s valid =
107- let badchars = ref false in
108- let buf = Buffer. create 0 in
109- for i = 0 to String. length s - 1 do
110- if ! badchars then (
111- if valid s.[i] then Buffer. add_char buf s.[i]
112- ) else if not (valid s.[i]) then (
113- Buffer. add_substring buf s 0 i ;
114- badchars := true
115- )
116- done ;
117- if ! badchars then
118- Buffer. contents buf
119- else
120- s
121-
122106 let map_unlikely s f =
123107 let changed = ref false in
124108 let m = ref 0 in
Original file line number Diff line number Diff line change @@ -34,9 +34,6 @@ module String : sig
3434 val replace : string -> string -> string -> string
3535 (* * replace all [f] substring in [s] by [t] *)
3636
37- val filter_chars : string -> (char -> bool ) -> string
38- (* * filter chars from a string *)
39-
4037 val map_unlikely : string -> (char -> string option ) -> string
4138 (* * map a string trying to fill the buffer by chunk *)
4239
Original file line number Diff line number Diff line change 1717 xapi-backtrace
1818 xapi-cli-protocol
1919 xapi-stdext-pervasives
20- xapi-stdext-std
2120 xapi-stdext-unix
2221 )
2322)
Original file line number Diff line number Diff line change 1313 *)
1414(* New cli talking to the in-server cli interface *)
1515
16- module Stringext = Xapi_stdext_std.Xstringext. String
1716open Xapi_stdext_pervasives
1817open Cli_protocol
1918
@@ -316,7 +315,7 @@ let parse_args =
316315 || (extra_args.[! i] = ',' && extra_args.[! i - 1 ] <> '\\' )
317316 then (
318317 let seg = String. sub extra_args ! pos (! i - ! pos) in
319- l := Stringext. filter_chars seg (( <> ) '\\' ) :: ! l ;
318+ l := Astring.String. filter (( <> ) '\\' ) seg :: ! l ;
320319 incr i ;
321320 pos := ! i
322321 ) else
You can’t perform that action at this time.
0 commit comments