3 Copyright 2000, 2015 Akira Kakuto.
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public License
16 along with this library; if not, see <http://www.gnu.org/licenses/>.
19 #include <kpathsea/kpathsea.h>
38 if (!(pathbuff
= mkpaths (&numtree
))) {
39 fprintf (stderr
, "Maybe you are not using ls-R.\n");
43 for (i
= 0; i
< numtree
; i
++) {
44 j
= (int)strlen (pathbuff
[i
]);
45 if (pathbuff
[i
][j
- 1] == '/')
46 pathbuff
[i
][j
- 1] = '\0';
50 pa
= strrchr (path
, '/');
52 fprintf (stderr
, "Path name of the file may be incorrect.\n");
53 for (i
= 0; i
< numtree
; i
++)
63 for (i
= 0; i
< numtree
; i
++) {
64 j
= (int)strlen (pathbuff
[i
]);
65 if (j
&& strnicmp (path
, pathbuff
[i
], j
) == 0) {
72 strcpy (lsrname
, pathbuff
[i
]);
73 strcat (lsrname
, "/ls-R");
74 if (_access (lsrname
, 0) != 0) {
75 for (j
= 0; j
< numtree
; j
++)
82 while (tolower (*pa
) == tolower (*pb
) && *pb
) {
86 f
= fopen (lsrname
, "ab");
87 fprintf (f
, "\n.%s:\n%s\n", pa
, fname
);
90 fprintf(stderr
, "mktexupd failed\n");
91 for (i
= 0; i
< numtree
; i
++)