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

Up lz4 (1.8.3)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Oct 05 23:02:32 2018 +0200 (2018-10-05)
parents 008ac2992c52
children 7b15fbf27388
line diff
     1.1 --- a/linld/stuff/src/ISO9660.CPP	Tue Mar 07 12:21:16 2017 +0100
     1.2 +++ b/linld/stuff/src/ISO9660.CPP	Fri Oct 05 23:02:32 2018 +0200
     1.3 @@ -32,7 +32,6 @@
     1.4  
     1.5  int isoreaddir(int restart)
     1.6  {
     1.7 -	static char dots[] = "..";
     1.8  	int size;
     1.9  	char *p;
    1.10  #ifdef __ROCKRIDGE
    1.11 @@ -49,9 +48,10 @@
    1.12  		if (x->curdirsize < DIRSECTORSZ) return -1;
    1.13  	restarted:
    1.14  		readsector(&x->curdirofs);
    1.15 -		x->curdirofs += SECTORSZ;
    1.16 +		//x->curdirofs += SECTORSZ;
    1.17 +		*(int *)((char *) &x->curdirofs+1) += SECTORSZ/256;
    1.18  		x->curdirsize -= DIRSECTORSZ;
    1.19 -		x->curpos = 0;
    1.20 +		x->curpos &= 0;
    1.21  	}
    1.22  	p = buffer + x->curpos;
    1.23  	if ((size = * (short *) p) == 0)
    1.24 @@ -59,6 +59,7 @@
    1.25  	x->fileofs = (* (unsigned long *) (p + 2)) << SECTORBITS;
    1.26  	x->filesize = * (unsigned long *) (p + 10);
    1.27  	x->filemod = (p[25] & 2) ? 0040755 : 0100755;
    1.28 +	//x->filemod = 0100755 - ((p[25] & (char)2) << 13);
    1.29  #ifdef __ROCKRIDGE
    1.30  	endname = NULL;
    1.31  	// p += 34 + (p[32] & -2); ?
    1.32 @@ -75,8 +76,7 @@
    1.33  			break;
    1.34  		}
    1.35  		p += len;
    1.36 -	}
    1.37 -	while (buffer + x->curpos + size > p + 2);
    1.38 +	} while (buffer + x->curpos + size - p > 2);
    1.39  	if (endname)
    1.40  		*endname = 0;
    1.41  	else
    1.42 @@ -84,14 +84,12 @@
    1.43  	{
    1.44  		p = x->filename = buffer + x->curpos + 33;
    1.45  		p--;
    1.46 -		switch (* (short *) p) {
    1.47 -		case 0x0101:
    1.48 -			x->filename = dots;
    1.49 -			break;
    1.50 -		case 0x0001:
    1.51 -			x->filename = dots + 1;
    1.52 -			break;
    1.53 -		default:
    1.54 +		if (((* (short *) p) & 0xFEFF) -1 == 0) {
    1.55 +			x->filename = "..";
    1.56 +			if ((* (short *) p) == 1)
    1.57 +				x->filename++;
    1.58 +		}
    1.59 +		else {
    1.60  			p += *p; p--;
    1.61  			if (* (short *) (p) != 0x313B) {
    1.62  				p++; p++; // no ;1 to remove