From: fred Date: Sun, 24 Mar 2002 19:49:13 +0000 (+0000) Subject: lilypond-0.0.77.jcn1 X-Git-Tag: release/1.5.59~4387 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=fccf7e07c937e2e36104c1649072dda34de9f708;p=lilypond.git lilypond-0.0.77.jcn1 --- diff --git a/lib/includable-lexer.cc b/lib/includable-lexer.cc index 792cbc46ae..6b4348d5f2 100644 --- a/lib/includable-lexer.cc +++ b/lib/includable-lexer.cc @@ -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<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 diff --git a/lily/main.cc b/lily/main.cc index 22f226d182..a87d9b2885 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -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){