]> git.donarmstrong.com Git - lilypond.git/commitdiff
lilypond-0.0.77.jcn1
authorfred <fred>
Sun, 24 Mar 2002 19:49:13 +0000 (19:49 +0000)
committerfred <fred>
Sun, 24 Mar 2002 19:49:13 +0000 (19:49 +0000)
lib/includable-lexer.cc
lily/main.cc

index 792cbc46aeba693fd42e14401b3d7bdb84333ab5..6b4348d5f2a9a6e49b9a0f439af1cc5d692b8ddb 100644 (file)
@@ -9,6 +9,10 @@
 #include "source-file.hh"
 #include "source.hh"
 
+#ifndef YY_BUF_SIZE
+#define YY_BUF_SIZE 16384
+#endif
+
 Includable_lexer::Includable_lexer()
 {
     yy_current_buffer = 0;
@@ -32,8 +36,17 @@ Includable_lexer::new_input(String s, Sources  * global_sources)
     cout << "[" << s<<flush;
     include_stack_.push(sl);    
     
-    // ugh. We'd want to create a buffer from the bytes directly.
-    yy_switch_to_buffer(yy_create_buffer( sl->istream_l(), sl->length_off() )); 
+    /*
+      ugh. We'd want to create a buffer from the bytes directly.
+
+      Whoops. The size argument to yy_create_buffer is not the
+      filelength but a BUFFERSIZE. Maybe this is why reading stdin fucks up.
+      
+      Maybe this is also the reason why LilyPond sometimes crashed
+      mysteriously in yy_create_buffer() with a libc-malloc error
+
+      */
+    yy_switch_to_buffer(yy_create_buffer( sl->istream_l(), YY_BUF_SIZE )); 
 }
 
 /** pop the inputstack.  conceptually this is a destructor, but it
index 22f226d182bf1901300cbdc41d9bc1633ba8b0e3..a87d9b28852241a821362f4e8bec1608094afa42 100644 (file)
@@ -105,12 +105,14 @@ static File_path path;
 void
 do_one_file(String init_str, String file_str)
 {
-    if ( "" == path.find( init_str ) )
+    if ( init_str != "" && "" == path.find( init_str ) ) {
        error ( "Can not find `" + init_str +"'");
-
-    if ( path.find( file_str ) == "" )
+       return ;
+    }
+    if ( file_str!= "" && path.find( file_str ) == "" ) {
        error ( "Can not find `" + file_str + "'");
-       
+       return ;
+    }
     
     Sources sources;
     source_l_g = &sources; 
@@ -142,7 +144,7 @@ main (int argc, char **argv)
 
     Getopt_long oparser(argc, argv,theopts);
     cout << get_version_str() << endl;
-    String init_str("symbol.ini");
+    String init_str("symbol.ly");
     
     while (Long_option_init * opt = oparser()) {
        switch ( opt->shortname){