From: Han-Wen Nienhuys Date: Sun, 4 Aug 2002 01:43:21 +0000 (+0000) Subject: (sane_putenv): Oops. Should supply a private copy X-Git-Tag: release/1.5.72~40 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=361489be435c6b4b15af790956cb5819b8dfc907;p=lilypond.git (sane_putenv): Oops. Should supply a private copy to putenv. (this was actually caught by valgrind, but I didn't think the error was mine... ) --- diff --git a/ChangeLog b/ChangeLog index bd11b2b774..6e7576c933 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ +2002-08-04 Han-Wen + + * lily/main.cc (sane_putenv): Oops. Should supply a private copy + to putenv. (this was actually caught by valgrind, but I didn't + think the error was mine... ) + 2002-08-03 Han-Wen + * tex/lilyponddefs.tex: add filllastpage support. + * GNUmakefile.in: barf if config.h is older than configure. * VERSION: released 1.5.71 diff --git a/flower/file-path.cc b/flower/file-path.cc index 84deaad08f..20dc9ab874 100644 --- a/flower/file-path.cc +++ b/flower/file-path.cc @@ -177,7 +177,7 @@ File_path::find (String nm) const Check if directory. TODO: encapsulate for autoconf */ struct stat sbuf; - if (stat (path.to_str0 (), &sbuf) == ENOENT) + if (stat (path.to_str0 (), &sbuf) != 0) continue; if (! (sbuf.st_mode & __S_IFREG)) @@ -185,7 +185,7 @@ File_path::find (String nm) const #endif #if !STAT_MACROS_BROKEN struct stat sbuf; - if (stat (path.to_str0 (), &sbuf) == ENOENT) + if (stat (path.to_str0 (), &sbuf) != 0) continue; if (S_ISDIR (sbuf.st_mode)) diff --git a/lily/main.cc b/lily/main.cc index d5be30fe68..11de9e3fb1 100644 --- a/lily/main.cc +++ b/lily/main.cc @@ -353,13 +353,6 @@ main_prog (void *, int, char **) int p=0; const char *arg = oparser_p_static->get_next_arg (); - - if (!arg) - { - usage (); - /* No FILE arguments is now a usage error */ - exit (2); - } do { @@ -408,7 +401,11 @@ static int sane_putenv (char const* key, char const* value, bool overwrite) { if (overwrite || !getenv (key)) - return putenv ((char*)((String (key) + "=" + value).to_str0 ())); + { + String combine = String (key) + "=" + String (value); + char * s = strdup(combine.to_str0 ()); + // return putenv (s); + } return -1; } @@ -511,6 +508,14 @@ main (int argc, char **argv) exit (0); } + + if (!oparser_p_static->current_arg () ) + { + usage (); + /* No FILE arguments is now a usage error */ + exit (2); + } + #ifdef WINNT scm_boot_guile (argc, argv, main_prog, 0); #else diff --git a/lily/parse-scm.cc b/lily/parse-scm.cc index 5c4e7ff422..aaf3b5d35b 100644 --- a/lily/parse-scm.cc +++ b/lily/parse-scm.cc @@ -15,6 +15,10 @@ SCM internal_ly_parse_scm (Parse_start * ps) { + /* + This is actually pretty wasteful: we stuff the rest of the entire + file down GUILE, while we usually need only a bit of it. + */ SCM str = ly_str02scm (ps->str); SCM port = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, "ly_eval_scm_0str"); diff --git a/scm/lily.scm b/scm/lily.scm index 8e00cc15dd..b5ff19cd69 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -11,6 +11,8 @@ ;;(write standalone (current-error-port)) +; (set-debug-cell-accesses! #t) + ;;; General settings diff --git a/tex/lilyponddefs.tex b/tex/lilyponddefs.tex index f3609dae4e..5509e7b2ec 100644 --- a/tex/lilyponddefs.tex +++ b/tex/lilyponddefs.tex @@ -74,9 +74,10 @@ \fi \def\EndLilyPondOutput{% - \vskip 0pt plus \lilypondpaperinterscorelinefill00 fill\csname bye\endcsname -} -\def\postheader{} +\ifundefined{lilypondpaperfilllastpage}% + \vskip 0pt plus \lilypondpaperinterscorelinefill00 fill +\fi +\csname bye\endcsname} % need to do some stuff to turn pagenumbering off % they seriously mess up your fragments.