]> git.donarmstrong.com Git - lilypond.git/commitdiff
PATCH: Fix unset PATH crash release/2.19.17-1
authorMasamichi Hosoda <trueroad@sea.plala.or.jp>
Sat, 7 Mar 2015 02:51:22 +0000 (19:51 -0700)
committercolincampbell <colinpkcampbell@gmail.com>
Thu, 12 Mar 2015 22:52:12 +0000 (16:52 -0600)
Per Masamichi Hosada:
On Windows, lilypond crashes when the environment variable PATH is not set.

```
C:\tmp\lilypond-2.19.16-0.mingw\$_OUTDIR\usr\bin>set PATH=

C:\tmp\lilypond-2.19.16-0.mingw\$_OUTDIR\usr\bin>lilypond
GNU LilyPond 2.19.16
terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

C:\tmp\lilypond-2.19.16-0.mingw\$_OUTDIR\usr\bin>
```

Even in the case of linux, this issue is a possible crash.

lily/relocate.cc

index 2adfb6f2f75c759d9b96b3d36fa383470c5975bd..73fde03f15dd77f656712654da90f1c6f5a05d2c 100644 (file)
@@ -181,7 +181,9 @@ setup_paths (char const *argv0_ptr)
         {
           /* Find absolute ARGV0 name, using PATH.  */
           File_path path;
-          path.parse_path (getenv ("PATH"));
+          char *p = getenv ("PATH");
+          if (p)
+            path.parse_path (p);
 
 #ifndef __MINGW32__
           argv0_abs = path.find (argv0_filename.to_string ());