wok-current diff linld/stuff/src/ISO9660.CPP @ rev 23984

linld: fix bootiso/strhead
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Nov 25 20:41:41 2020 +0000 (2020-11-25)
parents 53914b720f76
children a946c1651082
line diff
     1.1 --- a/linld/stuff/src/ISO9660.CPP	Tue Jun 23 13:35:04 2020 +0000
     1.2 +++ b/linld/stuff/src/ISO9660.CPP	Wed Nov 25 20:41:41 2020 +0000
     1.3 @@ -12,17 +12,17 @@
     1.4  #endif
     1.5  
     1.6  #ifdef ISOHOOK
     1.7 -void isoroot(void)
     1.8 +#define isoroot() \
     1.9 +{ \
    1.10 +	static const unsigned long root = 16UL * 2048; \
    1.11 +	isoreadsector(&root); \
    1.12 +	setdirofs(isostate.dirofs, (* (unsigned long *) (isostate.buffer + 0x9E))); \
    1.13 +	isostate.dirsize = filesize2dirsize(* (unsigned long *) (isostate.buffer + 0xA6)); \
    1.14 +}
    1.15  #else
    1.16  int isoroot(void)
    1.17 -#endif
    1.18  {
    1.19  	static const unsigned long root = 16UL * 2048;
    1.20 -#ifdef ISOHOOK
    1.21 -	isoreadsector(&root);
    1.22 -	setdirofs(isostate.dirofs, (* (unsigned long *) (isostate.buffer + 0x9E)));
    1.23 -	isostate.dirsize = filesize2dirsize(* (unsigned long *) (isostate.buffer + 0xA6));
    1.24 -#else
    1.25  	if (isoreadsector(&root) == -1 || strhead(isostate.buffer+1,"CD001") == -1) {
    1.26  		//close(isostate.fd);
    1.27  		return -1;
    1.28 @@ -30,8 +30,8 @@
    1.29  	setdirofs(isostate.dirofs, (* (unsigned long *) (isostate.buffer + 0x9E)));
    1.30  	isostate.dirsize = filesize2dirsize(* (unsigned long *) (isostate.buffer + 0xA6));
    1.31  	return 0;
    1.32 +}
    1.33  #endif
    1.34 -}
    1.35  
    1.36  int isoreaddir(void)
    1.37  {
    1.38 @@ -122,12 +122,7 @@
    1.39  #define _64bits (x->_64bits)
    1.40  	char *s;
    1.41  
    1.42 -#ifdef ISOHOOK
    1.43 -	extern int _cpuhaslm();
    1.44 -	_64bits = _cpuhaslm();
    1.45 -#else
    1.46  	_64bits = cpuhaslm();
    1.47 -#endif
    1.48      do {
    1.49  #ifdef ISOHOOK
    1.50  	s = (char *) x->filename2open;
    1.51 @@ -155,7 +150,7 @@
    1.52  			n = "64";
    1.53  			i += s - name; // strlen(name);
    1.54  		}
    1.55 -		if (strcmp(i, n)) continue;
    1.56 +		if (strcmp(i, n) == -1) continue;
    1.57  #ifndef ISOHOOK
    1.58  		*s++ = c;
    1.59  #endif