wok rev 19875

linld: fix chdirname
author Pascal Bellard <pascal.bellard@slitaz.org>
date Fri Mar 31 12:51:11 2017 +0200 (2017-03-31)
parents 766a40e6c5e0
children 96b6a30a3f9a
files linld/stuff/src/CRTL.ASM linld/stuff/src/CRTLX.H linld/stuff/upx.sh syslinux/stuff/iso2exe/upx.sh
line diff
     1.1 --- a/linld/stuff/src/CRTL.ASM	Fri Mar 31 10:37:54 2017 +0200
     1.2 +++ b/linld/stuff/src/CRTL.ASM	Fri Mar 31 12:51:11 2017 +0200
     1.3 @@ -165,29 +165,6 @@
     1.4          endp    _puts
     1.5  
     1.6  
     1.7 -		ifdef	EXTRA
     1.8 -;***************************************************************
     1.9 -;int chdir(char *path);
    1.10 -;***************************************************************
    1.11 -        global  _chdir:near
    1.12 -        proc    _chdir near
    1.13 -
    1.14 -		pop	ax
    1.15 -		pop	dx
    1.16 -		push	dx
    1.17 -		push	ax
    1.18 -chdir:
    1.19 -		stc
    1.20 -		mov	ax,713Bh
    1.21 -		int	21h
    1.22 -		jnc	chkc
    1.23 -		mov	ah,3Bh
    1.24 -		jmp	dos
    1.25 -
    1.26 -        endp    _chdir
    1.27 -		endif
    1.28 -
    1.29 -
    1.30  ;***************************************************************
    1.31  ;int fileattr(const char* name);
    1.32  ;***************************************************************
    1.33 @@ -1340,9 +1317,9 @@
    1.34          proc    _progname near
    1.35  
    1.36  		push	si di es
    1.37 -		xor	di,di
    1.38  		mov	ah,30h
    1.39  		int	21h
    1.40 +		xor	di,di
    1.41  		cmp	al,3
    1.42  		mov	ax,di
    1.43  		jb	@@skip
    1.44 @@ -1379,7 +1356,7 @@
    1.45  
    1.46  
    1.47  ;***************************************************************
    1.48 -;int chdirname(char *path)
    1.49 +;void chdirname(char *path)
    1.50  ;***************************************************************
    1.51          global  _chdirname:near
    1.52          proc    _chdirname near
    1.53 @@ -1391,35 +1368,36 @@
    1.54  
    1.55  		cmp	[byte bx+1],3Ah
    1.56  		jne	@@nodisk
    1.57 -		mov	dl,[bx]
    1.58 -		or	dl,20h
    1.59 +		mov	dl,20h
    1.60 +		or	dl,[bx]
    1.61  		sub	dl,61h
    1.62  		mov	ah,0Eh
    1.63 -		push	bx
    1.64  		int	21h
    1.65 -		pop	bx
    1.66  		inc	bx
    1.67  		inc	bx
    1.68  @@nodisk:
    1.69 -		mov	dx,bx
    1.70  		xor	cx,cx
    1.71  @@next:
    1.72  		mov	al,[bx]
    1.73  		cmp	al,5Ch
    1.74  		jne	@@tsteos
    1.75 -		mov	cx,bx
    1.76 +		mov	dx,bx
    1.77 +		inc	cx
    1.78  @@tsteos:
    1.79  		inc	bx
    1.80  		or	al,al
    1.81  		jnz	@@next
    1.82 -		cbw
    1.83  		jcxz	@@end
    1.84 -		mov	bx,cx
    1.85 +		mov	bx,dx
    1.86  		push	[word bx]
    1.87  		mov	[bx],al
    1.88 -		push	bx
    1.89 -		call	chdir
    1.90 -		pop	bx
    1.91 +		stc
    1.92 +		mov	ax,713Bh		; chdir long filename
    1.93 +		int	21h
    1.94 +		mov	ah,3Bh			; chdir
    1.95 +		jnc	chdirdone
    1.96 +		int	21h
    1.97 +chdirdone:
    1.98  		pop	[word bx]
    1.99  @@end:
   1.100  		ret
     2.1 --- a/linld/stuff/src/CRTLX.H	Fri Mar 31 10:37:54 2017 +0200
     2.2 +++ b/linld/stuff/src/CRTLX.H	Fri Mar 31 12:51:11 2017 +0200
     2.3 @@ -7,8 +7,7 @@
     2.4  extern "C" int strlen(const char* s);
     2.5  extern "C" char* strstr(const char* a,const char* b);
     2.6  extern "C" char *progname(void);
     2.7 -extern "C" int chdir(char *path);
     2.8 -extern "C" int chdirname(char *path);
     2.9 +extern "C" void chdirname(char *path);
    2.10  extern "C" unsigned long kver2ul(char *kernel_version);
    2.11  extern "C" char *ultoa(unsigned long n);
    2.12  extern "C" void try_default_args();
     3.1 --- a/linld/stuff/upx.sh	Fri Mar 31 10:37:54 2017 +0200
     3.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.3 @@ -1,12 +0,0 @@
     3.4 -#!/bin/sh
     3.5 -
     3.6 -upx -5 $1
     3.7 -o=$(($(stat -c %s $1) - 15))
     3.8 -if dd bs=1 skip=$o if=$1 count=15 2> /dev/null | hd | \
     3.9 -   grep -iq     "2c e8 3c 01 77 f9 c1 04  08 29 34 ad e2 f1 c3"; then
    3.10 -	echo "0  3C E8 75 FB 37 91 D3 04  91 |" | hexdump -R | \
    3.11 -	dd bs=1 seek=$o of=$1 conv=notrunc 2> /dev/null
    3.12 -else
    3.13 -	upx -d $1 > /dev/null 2>&1
    3.14 -	upx -5 --8086 $1
    3.15 -fi
     4.1 --- a/syslinux/stuff/iso2exe/upx.sh	Fri Mar 31 10:37:54 2017 +0200
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,12 +0,0 @@
     4.4 -#!/bin/sh
     4.5 -
     4.6 -upx -5 $1
     4.7 -o=$(($(stat -c %s $1) - 15))
     4.8 -if dd bs=1 skip=$o if=$1 count=15 2> /dev/null | hd | \
     4.9 -   grep -iq     "2c e8 3c 01 77 f9 c1 04  08 29 34 ad e2 f1 c3"; then
    4.10 -	echo "0  3C E8 75 FB 37 91 D3 04  91 |" | hexdump -R | \
    4.11 -	dd bs=1 seek=$o of=$1 conv=notrunc 2> /dev/null
    4.12 -else
    4.13 -	upx -d $1 > /dev/null 2>&1
    4.14 -	upx -5 --8086 $1
    4.15 -fi