#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;
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
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;
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){