Skip to content

Commit

Permalink
Use String.trim. Fixes: #4223
Browse files Browse the repository at this point in the history
  • Loading branch information
toots committed Nov 24, 2024
1 parent 1e3d1e6 commit 0c50a54
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/core/tools/server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -237,12 +237,9 @@ let () =
add "help" ~usage:"help [<command>]"
~descr:"Get information on available commands." (fun args ->
try
let args =
Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\\s*")
~subst:(fun _ -> "")
args
in
let args = String.trim args in
let _, us, d = Mutex_utils.mutexify lock (Hashtbl.find commands) args in
Printf.printf "Done\n%!";
Printf.sprintf "Usage: %s\r\n %s" us d
with Not_found ->
(if args <> "" then "No such command: " ^ args ^ "\r\n" else "")
Expand Down

0 comments on commit 0c50a54

Please sign in to comment.