wok-6.x rev 13552

syslinux: update c32box/linux (again)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Nov 02 10:54:05 2012 +0100 (2012-11-02)
parents 22b309e18635
children 14d7ba023d04
files syslinux/stuff/extra/md5sum.c
line diff
     1.1 --- a/syslinux/stuff/extra/md5sum.c	Fri Nov 02 10:44:52 2012 +0100
     1.2 +++ b/syslinux/stuff/extra/md5sum.c	Fri Nov 02 10:54:05 2012 +0100
     1.3 @@ -720,14 +720,18 @@
     1.4  static char *make_cmdline(char **argv)
     1.5  {
     1.6      char **arg;
     1.7 -    size_t bytes;
     1.8 +    size_t bytes, size;
     1.9      char *cmdline, *p;
    1.10 +    int i;
    1.11  
    1.12      bytes = 1;			/* Just in case we have a zero-entry cmdline */
    1.13      for (arg = argv; *arg; arg++) {
    1.14  	bytes += strlen(*arg) + 1;
    1.15      }
    1.16 -
    1.17 +    for (i = 0; i < 255; i++)
    1.18 +    	if (syslinux_getadv(i, &size))
    1.19 +    		bytes += ++size;
    1.20 +  
    1.21      p = cmdline = malloc(bytes);
    1.22      if (!cmdline)
    1.23  	return NULL;
    1.24 @@ -739,6 +743,14 @@
    1.25  	p += len + 1;
    1.26      }
    1.27  
    1.28 +    for (i = 0; i < 255; i++) {
    1.29 +    	const void *q = syslinux_getadv(i, &size);
    1.30 +    	if (q == NULL) continue;
    1.31 +    	memcpy(p, q, size);
    1.32 +	p[size] = ' ';
    1.33 +	p += size + 1;
    1.34 +    }
    1.35 +
    1.36      if (p > cmdline)
    1.37  	p--;			/* Remove the last space */
    1.38      *p = '\0';