X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Frelocate.cc;h=698f06ac64373bfd0475c882d0e990e62c4b4892;hb=a1c2a3a778efafbb8abbd44eb212a3f52f34c5f9;hp=69b27a8d4b3e8a24e37f44bbde8524198bf33252;hpb=0e5d83a9ceb4a143f83d22406d7eb816314ff9f7;p=lilypond.git diff --git a/lily/relocate.cc b/lily/relocate.cc index 69b27a8d4b..698f06ac64 100644 --- a/lily/relocate.cc +++ b/lily/relocate.cc @@ -1,10 +1,20 @@ /* - relocate.cc -- implement relocation based on argv0 + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2005--2010 Han-Wen Nienhuys - (c) 2005--2009 Han-Wen Nienhuys + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "relocate.hh" @@ -269,20 +279,20 @@ setup_paths (char const *argv0_ptr) string expand_environment_variables (string orig) { - const char *start_ptr = orig.c_str (); - const char *ptr = orig.c_str (); + char const *start_ptr = orig.c_str (); + char const *ptr = orig.c_str (); size_t len = orig.length (); string out; while (ptr < start_ptr + len) { - char *dollar = strchr (ptr, '$'); + char const *dollar = strchr (ptr, '$'); if (dollar != NULL) { - char *start_var = dollar + 1; - char *end_var = start_var; - char *start_next = end_var; + char const *start_var = dollar + 1; + char const *end_var = start_var; + char const *start_next = end_var; out += string (ptr, dollar - ptr); ptr = dollar; @@ -319,7 +329,7 @@ expand_environment_variables (string orig) if (start_var < end_var) { string var_name (start_var, end_var - start_var); - const char *value = getenv (var_name.c_str ()); + char const *value = getenv (var_name.c_str ()); if (value != NULL) out += string (value);