diff options
Diffstat (limited to 'lib/pathsrch.c')
-rw-r--r-- | lib/pathsrch.c | 53 |
1 files changed, 27 insertions, 26 deletions
diff --git a/lib/pathsrch.c b/lib/pathsrch.c index 5982355..f75b9cf 100644 --- a/lib/pathsrch.c +++ b/lib/pathsrch.c @@ -1,24 +1,25 @@ -/* pathsrch.c: look for files based on paths, i.e., colon-separated - lists of directories. - - We should allow % specifiers in the paths for the resolution, mode - name, etc. - -Copyright (C) 1992, 1993, 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, 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, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +# pathsrch.c: look for files based on paths, i.e., colon-separated +# lists of directories. +# +# Copyright (C) 1992, 1993, 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/>. +# + + +# We should allow % specifiers in the paths for the resolution, mode +# name, etc. #include "config.h" @@ -42,7 +43,7 @@ static string *find_dir_list P1H(string); static string readable P1H(string); static void save_dir_list P2H(string, string *); static string truncate_pathname P1H(string); - + /* If FILENAME is absolute or explicitly relative (i.e., starts with `/', `./', or `../'), or if DIR_LIST is null, we return whether FILENAME is readable as-is. Otherwise, we test if FILENAME is in any of @@ -195,7 +196,7 @@ absolute_p P1C(string, filename) return absolute || explicit_relative; } - + /* Return a NULL-terminated array of directory names, each name ending with PATH_SEP, created by parsing the PATH_DELIMITER-separated list in the value of the environment variable ENV_NAME, or DEFAULT_PATH if @@ -281,7 +282,7 @@ initialize_path_list P2C(string, env_name, string, default_path) return dir_list; } - + /* Subroutines for `initialize_path_list'. */ /* Add a newly-allocated copy of DIR to the end of the array pointed to @@ -380,7 +381,7 @@ expand_subdir (dir_list_ptr, dir_count_ptr, dirname) closedir (dir); } - + /* These routines, while not strictly needed to be exported, are plausibly useful to be called by outsiders. */ @@ -461,7 +462,7 @@ expand_tilde P1C(string, name) return expansion; #endif /* not (DOS or VMS or VM/CMS) */ } - + /* Routines to save and retrieve a directory list keyed by the original colon-separated path. This is useful because 1) it can take a significant amount of time to discover all the subdirectories of a |