search for: refdup_word

Displaying 7 results from an estimated 7 matches for "refdup_word".

2016 Jun 29
0
Fwd: [PATCH] {vesa}menu.c32 feature => hide menu entry for specific sources
...t char *a; @@ -744,9 +774,14 @@ static void parse_config_file(FILE * f) } else if ((ep = looking_at(p, "include"))) { goto do_include; } else if ((ep = looking_at(p, "background"))) { - p = skipspace(ep); - refstr_put(m->menu_background); - m->menu_background = refdup_word(&p); + p = skipspace(ep); + refstr_put(m->menu_background); + m->menu_background = refdup_word(&p); + } else if ((ep = looking_at(p, "hideifnot"))){ + if (ld.label) { + refstr_put(ld.visiblesource); + ld.visiblesource = refstrdup(skipspace(p + 9)); + } }...
2010 Apr 23
1
Path simple menu integrated progress indicator
...-------------------- */ +#include <stdio.h> #include <stdlib.h> #include <string.h> +#include <fcntl.h> +#include <sys/stat.h> +#include <syslinux/linux.h> + #include <com32.h> #include "menu.h" +bool opt_quiet = false; + +static const char *refdup_word(char **p) +{ + char *sp = *p; + char *ep = sp; + + while (*ep && !my_isspace(*ep)) + ep++; + + *p = ep; + return refstrndup(sp, ep - sp); +} + + +// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +char *skip_spaces(char *s) +{ + while(*s &a...
2013 Jun 12
3
[5.10] PXE + dhcp opts 209, 210 and path issues in tftp/http
On Wed, 12 Jun, at 11:17:44AM, Gerardo Exequiel Pozzi wrote: > Cool thanks!. Now looks better, but still not work. > > For some reason, "ldlinux.c32" is apparently sent but "Failed to load" > by PXELINUX and few seconds later, dnsmasq shows an error message > "failed sending": Argh! The patch was broken. I missed the new core/path.c file. My bad.
2013 Jun 12
5
[5.10] PXE + dhcp opts 209, 210 and path issues in tftp/http
...[]; +/* + * PATH-based lookup + * + * Each entry in the PATH directive is separated by a space, e.g. + * + * PATH /bar /bin/foo /baz/bar/bin + */ +static int parse_path(char *p) +{ + struct path_entry *entry; + const char *str; + + while (*p) { + /* Find the next directory */ + str = refdup_word(&p); + if (!str) + goto bail; + + entry = path_add(str); + refstr_put(str); + + if (!entry) + goto bail; + + p = skipspace(p); + } + + return 0; + +bail: + return -1; +} + static void parse_config_file(FILE * f) { char line[MAX_LINE], *p, *ep, ch; @@ -1337,24 +1370,8 @@...
2013 Jun 12
0
[5.10] PXE + dhcp opts 209, 210 and path issues in tftp/http
...[]; +/* + * PATH-based lookup + * + * Each entry in the PATH directive is separated by a space, e.g. + * + * PATH /bar /bin/foo /baz/bar/bin + */ +static int parse_path(char *p) +{ + struct path_entry *entry; + const char *str; + + while (*p) { + /* Find the next directory */ + str = refdup_word(&p); + if (!str) + goto bail; + + entry = path_add(str); + refstr_put(str); + + if (!entry) + goto bail; + + p = skipspace(p); + } + + return 0; + +bail: + return -1; +} + static void parse_config_file(FILE * f) { char line[MAX_LINE], *p, *ep, ch; @@ -1337,24 +1370,8 @@...
2013 Jun 11
2
[5.10] PXE + dhcp opts 209, 210 and path issues in tftp/http
On Mon, 10 Jun, at 07:57:50AM, H. Peter Anvin wrote: > Either that or make the path a list rather than a string, using the > normal word separators when entered on the command line, a bit like the > (t)csh does. That is a bigger change but is probably a better solution. How would this solution handle filenames containing spaces? Would we need to escape (presumably with a backslash)
2013 Jun 12
0
[5.10] PXE + dhcp opts 209, 210 and path issues in tftp/http
...he PATH directive is separated by a space, e.g. > + * > + * PATH /bar /bin/foo /baz/bar/bin > + */ > +static int parse_path(char *p) > +{ > + struct path_entry *entry; > + const char *str; > + > + while (*p) { > + /* Find the next directory */ > + str = refdup_word(&p); > + if (!str) > + goto bail; > + > + entry = path_add(str); > + refstr_put(str); > + > + if (!entry) > + goto bail; > + > + p = skipspace(p); > + } > + > + return 0; > + > +bail: > + return -1; > +} > + > static voi...