diff options
Diffstat (limited to 'lib/progname.c')
-rw-r--r-- | lib/progname.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/lib/progname.c b/lib/progname.c index 3221147..f8f964d 100644 --- a/lib/progname.c +++ b/lib/progname.c @@ -1,20 +1,21 @@ -/* progname.c: the executable name we were invoked as; general initialization. +# progname.c: the executable name we were invoked as; general initialization. +# +# Copyright (C) 1994, 1996, 1997, 2011 Free Software Foundation, Inc. +# +# This program 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. +# +# This program 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 this program. If not, see <http://www.gnu.org/licenses/>. +# -Copyright (C) 1994, 1996, 1997, 2011 Free Software Foundation, Inc. - -This library is free software; you can redistribute it and/or -modify it under the terms of the GNU Library General Public -License as published by the Free Software Foundation; either -version 3 of the License, or (at your option) any later version. - -This library 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 -Library General Public License for more details. - -You should have received a copy of the GNU Library General Public -License along with this library; if not, write to the Free Software -Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include "c-pathch.h" @@ -52,7 +53,7 @@ string program_invocation_short_name = NULL; #endif /* And the variable for the program we pretend to be. */ string kpse_program_name = NULL; - + /* Return directory for NAME. This is "." if NAME contains no directory separators (should never happen for selfdir), else whatever precedes the final directory separator, but with multiple separators stripped. @@ -86,7 +87,7 @@ my_dirname P1C(const_string, name) return ret; } - + #ifndef WIN32 /* From a standalone program `ll' to expand symlinks written by Kimbo Mundy. Don't bother to compile if we don't have symlinks; thus we can assume @@ -284,7 +285,7 @@ expand_symlinks (s) #else /* not S_ISLNK */ #define expand_symlinks(s) (s) #endif /* not S_ISLNK */ - + /* Remove .'s and ..'s in DIR, to avoid problems with relative symlinks as the program name, etc. This does not canonicalize symlinks. */ @@ -353,7 +354,7 @@ remove_dots P1C(string, dir) return ret; #endif /* not AMIGA */ } - + /* Return directory ARGV0 comes from. Check PATH if ARGV0 is not absolute. */ @@ -424,7 +425,7 @@ selfdir P1C(const_string, argv0) return ret; } #endif /* not WIN32 */ - + void kpse_set_program_name P2C(const_string, argv0, const_string, progname) { @@ -592,7 +593,7 @@ kpse_set_progname P1C(const_string, argv0) { kpse_set_program_name (argv0, NULL); } - + #ifdef TEST void main (int argc, char **argv) |