aboutsummaryrefslogtreecommitdiffstats
path: root/com32/gfxboot
diff options
context:
space:
mode:
authorSebastian Herbszt <herbszt@gmx.de>2011-03-30 20:33:49 +0200
committerSebastian Herbszt <herbszt@gmx.de>2011-03-30 20:33:49 +0200
commit2c6aee82bf8008322e97215682ed40bd640c64c3 (patch)
treeb893c1473dde837a868fb0c584b9ab95c79301f0 /com32/gfxboot
parent0620743d1e54cf48aa8e5cf5636739addae49d60 (diff)
downloadsyslinux-2c6aee82bf8008322e97215682ed40bd640c64c3.tar.gz
syslinux-2c6aee82bf8008322e97215682ed40bd640c64c3.tar.xz
syslinux-2c6aee82bf8008322e97215682ed40bd640c64c3.zip
gfxboot: use skipspace()
Use skipspace() instead of local skip_spaces(). Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
Diffstat (limited to 'com32/gfxboot')
-rw-r--r--com32/gfxboot/gfxboot.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/com32/gfxboot/gfxboot.c b/com32/gfxboot/gfxboot.c
index 552728fd..a312a2c6 100644
--- a/com32/gfxboot/gfxboot.c
+++ b/com32/gfxboot/gfxboot.c
@@ -22,6 +22,7 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <minmax.h>
+#include <ctype.h>
#include <syslinux/loadfile.h>
#include <syslinux/config.h>
@@ -160,7 +161,6 @@ unsigned progress_active;
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void show_message(char *file);
char *get_config_file_name(void);
-char *skip_spaces(char *s);
char *skip_nonspaces(char *s);
void chop_line(char *s);
int read_config_file(const char *filename);
@@ -274,15 +274,6 @@ void show_message(char *file)
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-char *skip_spaces(char *s)
-{
- while(*s && (*s == ' ' || *s == '\t')) s++;
-
- return s;
-}
-
-
-// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
char *skip_nonspaces(char *s)
{
while(*s && *s != ' ' && *s != '\t') s++;
@@ -336,11 +327,11 @@ int read_config_file(const char *filename)
while((s = fgets(buf, sizeof buf, f))) {
chop_line(s);
- s = skip_spaces(s);
+ s = skipspace(s);
if(!*s || *s == '#') continue;
t = skip_nonspaces(s);
if(*t) *t++ = 0;
- t = skip_spaces(t);
+ t = skipspace(t);
if(!strcasecmp(s, "endtext")) {
text = 0;
@@ -410,10 +401,10 @@ int read_config_file(const char *filename)
}
if(!strcasecmp(s, "menu") && menu_ptr) {
- s = skip_spaces(t);
+ s = skipspace(t);
t = skip_nonspaces(s);
if(*t) *t++ = 0;
- t = skip_spaces(t);
+ t = skipspace(t);
if(!strcasecmp(s, "label")) {
menu_ptr->menu_label = strdup(t);
@@ -842,7 +833,7 @@ void boot(int index)
// invalid index or menu entry
if(!menu_ptr || !menu_ptr->menu_label) return;
- arg = skip_spaces(cmdline);
+ arg = skipspace(cmdline);
label_len = strlen(menu_ptr->menu_label);
// if it does not start with label string, assume first word is kernel name
@@ -856,7 +847,7 @@ void boot(int index)
arg += label_len;
}
- arg = skip_spaces(arg);
+ arg = skipspace(arg);
// handle IPAPPEND
if(menu_ptr->ipappend && (ipapp = atoi(menu_ptr->ipappend))) {
@@ -942,7 +933,7 @@ void boot_entry(menu_t *menu_ptr, char *arg)
s = s0 = strdup(arg);
while(*s && strncmp(s, "initrd=", sizeof "initrd=" - 1)) {
- s = skip_spaces(skip_nonspaces(s));
+ s = skipspace(skip_nonspaces(s));
}
if(*s) {