Adding upstream version 6.03~pre2+dfsg.
[syslinux-debian/hramrach.git] / core / fs / lib / loadconfig.c
blob95e6f3f84e8908c64fba5a77030173c63b638c12
1 #include <dprintf.h>
2 #include <stdio.h>
3 #include <string.h>
4 #include <core.h>
5 #include <fs.h>
7 /*
8 * Standard version of load_config for extlinux/syslinux filesystems.
10 * This searches for extlinux.conf and syslinux.cfg in the install
11 * directory, followed by a set of fallback directories. If found,
12 * set the current working directory to match.
14 int generic_open_config(struct com32_filedata *filedata)
16 static const char *search_directories[] = {
17 NULL, /* CurrentDirName */
18 "/boot/syslinux",
19 "/syslinux",
20 "/",
21 NULL
23 static const char *filenames[] = {
24 "extlinux.conf",
25 "syslinux.cfg",
26 NULL
29 search_directories[0] = CurrentDirName;
31 dprintf("CurrentDirName: \"%s\"\n", CurrentDirName);
33 return search_dirs(filedata, search_directories, filenames, ConfigName);