Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37045283
en ru br
Репозитории ALT

Группа :: Разработка/ML
Пакет: ocaml-dose3

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: ocaml-dose3-safe-string.patch
Скачать


diff --git a/common/criteria_lexer.mll b/common/criteria_lexer.mll
index 71f9178..e5a2376 100644
--- a/common/criteria_lexer.mll
+++ b/common/criteria_lexer.mll
@@ -18,7 +18,7 @@
     let c = Lexing.lexeme_char lexbuf 2 in (* the delimiter can be any character *)
     (* find the terminating delimiter *)
     let endpos =
-      try String.index_from lexbuf.lex_buffer (lexbuf.lex_start_pos + 3) c with
+      try String.index_from (Lexing.lexeme lexbuf) (lexbuf.lex_start_pos + 3) c with
       |Invalid_argument _ ->
           raise (Format822.Syntax_error (
             Format822.error lexbuf "String too short"))
@@ -27,7 +27,7 @@
             Format822.error lexbuf (Printf.sprintf "cannot find: %c" c)))
     in
     let len = endpos - (lexbuf.lex_start_pos + 3) in
-    let s = String.sub lexbuf.lex_buffer (lexbuf.lex_start_pos + 3) len in
+    let s = String.sub (Lexing.lexeme lexbuf) (lexbuf.lex_start_pos + 3) len in
     lexbuf.Lexing.lex_curr_pos <- lexbuf.Lexing.lex_start_pos + ((String.length s)+4);
     s
 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin