Skip to content

Commit 69ea45b

Browse files
committed
catch Zed_string.Invalid
1 parent 387c1c1 commit 69ea45b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/lTerm_history.ml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -390,15 +390,17 @@ let load history ?log ?(skip_empty=true) ?(skip_dup=true) fn =
390390
| None ->
391391
return ()
392392
| Some line ->
393-
let line= Zed_string.unsafe_of_utf8 line in
394-
(try
393+
(try
394+
let line= Zed_string.of_utf8 line in
395395
let entry, size = unescape line in
396396
if not (skip_empty && is_empty entry) && not (skip_dup && is_dup history entry) then begin
397397
add_aux history entry size;
398398
history.old_count <- history.length
399399
end
400-
with Zed_utf8.Invalid (msg, _) ->
401-
log num msg);
400+
with
401+
| Zed_string.Invalid (msg, _)-> log num msg
402+
| Zed_utf8.Invalid (msg, _)-> log num msg
403+
);
402404
aux (num + 1)
403405
in
404406
aux 1)

0 commit comments

Comments
 (0)