diff options
author | Matt Fleming <matt.fleming@intel.com> | 2013-01-29 14:01:07 +0000 |
---|---|---|
committer | Matt Fleming <matt.fleming@intel.com> | 2013-01-29 15:11:28 +0000 |
commit | bf20364b582c383b4927f898de213b1cc0981a80 (patch) | |
tree | 5412e0c14cf74df0d7ea29ff182e23d3281aac3e /com32/elflink/ldlinux/readconfig.c | |
parent | afd985f6eec18a0f66a8fc55f9c5e3431128310f (diff) | |
parent | a2d79191b501276026a0a16ec2fa664630a20476 (diff) | |
download | syslinux-bf20364b582c383b4927f898de213b1cc0981a80.tar.gz |
Merge tag 'syslinux-5.01' into firmwaresyslinux-6.00-pre4
Conflicts:
Makefile
NEWS
com32/cmenu/Makefile
com32/elflink/ldlinux/Makefile
com32/gfxboot/Makefile
com32/gpllib/Makefile
com32/include/sys/module.h
com32/lib/Makefile
com32/lib/sys/module/elf_module.c
com32/menu/Makefile
com32/rosh/Makefile
com32/samples/Makefile
core/init.c
mk/elf.mk
Signed-off-by: Matt Fleming <matt.fleming@intel.com>
Diffstat (limited to 'com32/elflink/ldlinux/readconfig.c')
-rw-r--r-- | com32/elflink/ldlinux/readconfig.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/com32/elflink/ldlinux/readconfig.c b/com32/elflink/ldlinux/readconfig.c index 6a419c6d..a2421e95 100644 --- a/com32/elflink/ldlinux/readconfig.c +++ b/com32/elflink/ldlinux/readconfig.c @@ -26,6 +26,7 @@ #include <syslinux/config.h> #include <dprintf.h> #include <ctype.h> +#include <bios.h> #include <core.h> #include <fs.h> @@ -79,7 +80,6 @@ short allowoptions = 1; //user-specified options allowed short includelevel = 1; //nesting level short defaultlevel = 0; //the current level of default short vkernel = 0; //have we seen any "label" statements? -short displaycon = 1; //conio.inc extern short NoHalt; //idle.c const char *onerror = NULL; //"onerror" command line @@ -442,12 +442,12 @@ void print_labels(const char *prefix, size_t len) { struct menu_entry *me; - eprintf("\n"); + printf("\n"); for (me = all_entries; me; me = me->next ) { if (!strncmp(prefix, me->label, len)) - eprintf(" %s", me->label); + printf(" %s", me->label); } - eprintf("\n"); + printf("\n"); } struct menu_entry *find_label(const char *str) @@ -498,18 +498,24 @@ static const char *unlabel(const char *str) return str; } -static const char *refdup_word(char **p) +static const char *__refdup_word(char *p, char **ref) { - char *sp = *p; + char *sp = p; char *ep = sp; while (*ep && !my_isspace(*ep)) ep++; - *p = ep; + if (ref) + *ref = ep; return refstrndup(sp, ep - sp); } +static const char *refdup_word(char **p) +{ + return __refdup_word(*p, p); +} + int my_isxdigit(char c) { unsigned int uc = c; @@ -690,7 +696,7 @@ void cat_help_file(int key) return; if (cm->fkeyhelp[fkey].textname) { - eprintf("\n"); + printf("\n"); get_msg_file((char *)cm->fkeyhelp[fkey].textname); } } @@ -729,12 +735,6 @@ extern void sirq_cleanup_nowipe(void); extern void sirq_install(void); extern void write_serial_str(char *); -static inline void io_delay(void) -{ - outb(0, 0x80); - outb(0, 0x80); -} - extern void loadfont(char *); extern void loadkeys(char *); @@ -1065,8 +1065,8 @@ do_include: p = skipspace(p + 5); /* when first time see "label", it will not really record anything */ record(m, &ld, append); - ld.label = refstrdup(p); - ld.kernel = refstrdup(p); + ld.label = __refdup_word(p, NULL); + ld.kernel = __refdup_word(p, NULL); /* feng: this is the default type for all */ ld.type = KT_KERNEL; ld.passwd = NULL; @@ -1174,7 +1174,7 @@ do_include: } else if (looking_at(p, "prompt")) { forceprompt = atoi(skipspace(p + 6)); } else if (looking_at(p, "console")) { - displaycon = atoi(skipspace(p + 7)); + DisplayCon = atoi(skipspace(p + 7)); } else if (looking_at(p, "allowoptions")) { allowoptions = atoi(skipspace(p + 12)); } else if (looking_at(p, "noescape")) { @@ -1311,8 +1311,9 @@ do_include: write_serial_str(syslinux_banner); write_serial_str(copyright_str); } + } else if (looking_at(p, "say")) { - eprintf("%s\n", p+4); + printf("%s\n", p+4); } else if (looking_at(p, "path")) { /* PATH-based lookup */ const char *new_path; @@ -1331,7 +1332,7 @@ do_include: free(PATH); PATH = _p; } else - eprintf("Failed to realloc PATH\n"); + printf("Failed to realloc PATH\n"); } } } @@ -1350,15 +1351,15 @@ static int parse_one_config(const char *filename) if (fd < 0) return fd; - f = fdopen(fd, mode); - parse_config_file(f); - if (config_cwd[0]) { if (chdir(config_cwd) < 0) printf("Failed to chdir to %s\n", config_cwd); config_cwd[0] = '\0'; } + f = fdopen(fd, mode); + parse_config_file(f); + return 0; } |