]> git.donarmstrong.com Git - lilypond.git/commitdiff
(sane_putenv): Oops. Should supply a private copy
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 4 Aug 2002 01:43:21 +0000 (01:43 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 4 Aug 2002 01:43:21 +0000 (01:43 +0000)
to putenv. (this was actually caught by valgrind, but I didn't
think the error was mine... )

ChangeLog
flower/file-path.cc
lily/main.cc
lily/parse-scm.cc
scm/lily.scm
tex/lilyponddefs.tex

index bd11b2b774e9d5e7aeb61a865ae408501bdedd77..6e7576c9337c33525fe64cfc5fdc59bccc7dccde 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
+2002-08-04  Han-Wen  <hanwen@cs.uu.nl>
+
+       * 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  <hanwen@cs.uu.nl>
 
+       * tex/lilyponddefs.tex: add filllastpage support.
+
        * GNUmakefile.in: barf if config.h is older than configure. 
 
        * VERSION: released 1.5.71 
index 84deaad08f278816a7c4f9820b267285ef2c3adc..20dc9ab874c06605d4e02e4875871e02e15f98e3 100644 (file)
@@ -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))
index d5be30fe6882a06b1775690952c4d514028c8a8b..11de9e3fb1b9c44c00f58095526cb8e4b962c421 100644 (file)
@@ -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
index 5c4e7ff4221b8989cf5ff5cb9e31703a868d93b0..aaf3b5d35badcb2e717a79dff93a859a995c03bc 100644 (file)
 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");
index 8e00cc15dd26c3dfa8811a102c9107c437c2eb73..b5ff19cd69db3f85205120477f59683e25526ceb 100644 (file)
@@ -11,6 +11,8 @@
 
 ;;(write standalone (current-error-port))
 
+; (set-debug-cell-accesses! #t)
+
 ;;; General settings
 
 
index f3609dae4e5232c509acd194345a57e9abccc7c9..5509e7b2ecd41ff8f109820fc21f58efd65cbb64 100644 (file)
 \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.