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 @@ -98,20 +98,6 @@ module String = struct
9898 ) else
9999 s
100100
101- let filter_chars s valid =
102- let badchars = ref false in
103- let buf = Buffer. create 0 in
104- for i = 0 to String. length s - 1 do
105- if ! badchars then (
106- if valid s.[i] then
107- Buffer. add_char buf s.[i]
108- ) else if not (valid s.[i]) then (
109- Buffer. add_substring buf s 0 i ;
110- badchars := true
111- )
112- done ;
113- if ! badchars then Buffer. contents buf else s
114-
115101 let map_unlikely s f =
116102 let changed = ref false in
117103 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
@@ -306,7 +305,7 @@ let parse_args =
306305 || (extra_args.[! i] = ',' && extra_args.[! i - 1 ] <> '\\' )
307306 then (
308307 let seg = String. sub extra_args ! pos (! i - ! pos) in
309- l := Stringext. filter_chars seg (( <> ) '\\' ) :: ! l ;
308+ l := Astring.String. filter (( <> ) '\\' ) seg :: ! l ;
310309 incr i ;
311310 pos := ! i
312311 ) else
You can’t perform that action at this time.
0 commit comments