diff options
author | Karl Berry <karl@freefriends.org> | 2008-01-13 21:33:00 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2008-01-13 21:33:00 +0000 |
commit | da3e320d2f5628449299c09fe1b413f5852cd6d1 (patch) | |
tree | f4406abcf21e31bbc2688633311dbbbed50680a1 /Build/source/texk/kpathsea/kpsewhich.c | |
parent | 08ffcc25acc42d01f5d3aecece204520a2076ffe (diff) |
protect against loc<=0, from dak
git-svn-id: svn://tug.org/texlive/trunk@6217 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/kpathsea/kpsewhich.c')
-rw-r--r-- | Build/source/texk/kpathsea/kpsewhich.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Build/source/texk/kpathsea/kpsewhich.c b/Build/source/texk/kpathsea/kpsewhich.c index 2ef873c3e6a..98f5c51b002 100644 --- a/Build/source/texk/kpathsea/kpsewhich.c +++ b/Build/source/texk/kpathsea/kpsewhich.c @@ -1,7 +1,7 @@ /* kpsewhich -- standalone path lookup and variable expansion for Kpathsea. Ideas from Thomas Esser, Pierre MacKay, and many others. - Copyright (C) 1995-2007 Karl Berry & Olaf Weber. + Copyright (C) 1995-2008 Karl Berry & Olaf Weber. This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public @@ -188,7 +188,7 @@ subdir_match P2C(str_list_type, subdirs, string *, matches) string s = xstrdup (matches[m]); for (loc = strlen (s); loc > 0 && !IS_DIR_SEP (s[loc-1]); loc--) ; - while (IS_DIR_SEP (s[loc-1])) { + while (loc > 0 && IS_DIR_SEP (s[loc-1])) { loc--; } s[loc] = 0; /* wipe out basename */ |