[Pkg-ocaml-maint-commits] r2866 - in /trunk/packages/mldonkey/trunk/debian: changelog utils/Makefile.files utils/Makefile.options utils/lexer_options.mll

smimram at users.alioth.debian.org smimram at users.alioth.debian.org
Fri Jun 23 13:44:00 UTC 2006


Author: smimram
Date: Fri Jun 23 13:43:57 2006
New Revision: 2866

URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/?sc=1&rev=2866
Log:
mldonkey_options now correctly handles \" in strings.

Modified:
    trunk/packages/mldonkey/trunk/debian/changelog
    trunk/packages/mldonkey/trunk/debian/utils/Makefile.files
    trunk/packages/mldonkey/trunk/debian/utils/Makefile.options
    trunk/packages/mldonkey/trunk/debian/utils/lexer_options.mll

Modified: trunk/packages/mldonkey/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/mldonkey/trunk/debian/changelog?rev=2866&op=diff
==============================================================================
--- trunk/packages/mldonkey/trunk/debian/changelog (original)
+++ trunk/packages/mldonkey/trunk/debian/changelog Fri Jun 23 13:43:57 2006
@@ -1,5 +1,6 @@
 mldonkey (2.7.7-2) UNRELEASED; urgency=low
 
+  * mldonkey_options now correctly handles \" in strings, closes: #354433.
   * Disabling DirectConnect plugin for now since it is unstable and does not
     support uploading, closes: #224836.
   * Use ucf in postrm only if present, closes: #333314.

Modified: trunk/packages/mldonkey/trunk/debian/utils/Makefile.files
URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/mldonkey/trunk/debian/utils/Makefile.files?rev=2866&op=diff
==============================================================================
--- trunk/packages/mldonkey/trunk/debian/utils/Makefile.files (original)
+++ trunk/packages/mldonkey/trunk/debian/utils/Makefile.files Fri Jun 23 13:43:57 2006
@@ -90,7 +90,7 @@
 # LIBS=$(WITHGRAPHICS) $(WITHUNIX) $(WITHSTR) $(WITHNUMS) $(WITHTHREADS)\
 # $(WITHDBM)
 
-LIBS=
+LIBS=$(WITHSTR)
 
 # Should be set to -custom if you use any of the libraries above
 # or if any C code have to be linked with your program

Modified: trunk/packages/mldonkey/trunk/debian/utils/Makefile.options
URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/mldonkey/trunk/debian/utils/Makefile.options?rev=2866&op=diff
==============================================================================
--- trunk/packages/mldonkey/trunk/debian/utils/Makefile.options (original)
+++ trunk/packages/mldonkey/trunk/debian/utils/Makefile.options Fri Jun 23 13:43:57 2006
@@ -88,7 +88,7 @@
 # LIBS=$(WITHGRAPHICS) $(WITHUNIX) $(WITHSTR) $(WITHNUMS) $(WITHTHREADS)\
 # $(WITHDBM)
 
-LIBS=
+LIBS=$(WITHSTR)
 
 # Should be set to -custom if you use any of the libraries above
 # or if any C code have to be linked with your program

Modified: trunk/packages/mldonkey/trunk/debian/utils/lexer_options.mll
URL: http://svn.debian.org/wsvn/pkg-ocaml-maint/trunk/packages/mldonkey/trunk/debian/utils/lexer_options.mll?rev=2866&op=diff
==============================================================================
--- trunk/packages/mldonkey/trunk/debian/utils/lexer_options.mll (original)
+++ trunk/packages/mldonkey/trunk/debian/utils/lexer_options.mll Fri Jun 23 13:43:57 2006
@@ -1,17 +1,19 @@
 {
 open Parse_options;;
 open Lexing;;
+
+let incrline lexbuf =
+        lexbuf.lex_curr_p <-
+                {
+                        lexbuf.lex_curr_p with 
+                        pos_lnum = lexbuf.lex_curr_p.pos_lnum + 1;
+                        pos_bol = lexbuf.lex_curr_p.pos_cnum + 1;
+                }
 }
 
 rule token = parse
-[' ' '\t']      { token lexbuf }
-| '\n'                          {
-                                  lexbuf.lex_curr_p <- { lexbuf.lex_curr_p with 
-                                    pos_lnum = lexbuf.lex_curr_p.pos_lnum + 1;
-                                    pos_bol = lexbuf.lex_curr_p.pos_cnum + 1;
-                                  };
-                                  token lexbuf
-                                }
+| [' ' '\t']      { token lexbuf }
+| '\n'           { incrline lexbuf; token lexbuf }
 | ['0'-'9']+ '.' ['0'-'9']*  { FLOAT(float_of_string(lexeme lexbuf)) }
 | ['0'-'9']+      { INT(Int64.of_string(lexeme lexbuf)) }
 | '='        { EQUAL }
@@ -25,18 +27,14 @@
 | ')'        { END_LIST }
 | ','        { SEP_LIST }
 | '.'        { SEP_LIST }
-| '"'        { STRING(str lexbuf) }
+| '"' (([^'"'] | '\\' '"')* as s) '"'   {
+        String.iter (fun c -> if c = '\n' then incrline lexbuf) s;
+        STRING (Str.global_replace (Str.regexp "\\\\\"") "\"" s) }
 | ['A'-'Z' 'a'-'z'] ['A'-'Z' 'a'-'z' '0'-'9' '_'] * { IDENT(Lexing.lexeme lexbuf) }
 | eof        { EOF }
 
-
-and str = parse
-'"'        { "" }
-| [^'"']*      { let s = (Lexing.lexeme lexbuf) in
-        s ^ ( str lexbuf ) }
-
 and comment = parse
-"*)"    { "*)" }
+| "*)"    { "*)" }
 | '*'    { "*" ^ (comment lexbuf) }
 | [^'*']*  { let s = (Lexing.lexeme lexbuf) in 
     s ^ (comment lexbuf) }




More information about the Pkg-ocaml-maint-commits mailing list