2 * Copyright (C) 2010, Hib Eris <hib@hiberis.nl>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
32 char *env = getenv("TEXMFCNF");
37 gchar *texmfcnf = NULL;
38 TCHAR path[_MAX_PATH];
40 if (SearchPath(NULL, "mktexpk", ".exe", _MAX_PATH, path, NULL))
42 gchar *sdir, *sdir_parent, *sdir_grandparent;
43 const gchar *texmfcnf_fmt = "{%s,%s,%s}{,{/share,}/texmf{-local,}/web2c}";
45 sdir = g_path_get_dirname(path);
46 sdir_parent = g_path_get_dirname(sdir);
47 sdir_grandparent = g_path_get_dirname(sdir_parent);
49 texmfcnf = g_strdup_printf(texmfcnf_fmt,
50 sdir, sdir_parent, sdir_grandparent);
54 g_free(sdir_grandparent);