forked from KolibriOS/kolibrios
requested changes (all)
This commit is contained in:
@@ -3,6 +3,6 @@
|
||||
|
||||
format binary as ""
|
||||
|
||||
TARGET equ '/kolibrios/emul/dgen/dgen'
|
||||
WRAPPER_SUFFIX equ '_open'
|
||||
|
||||
include '../../quotkinizer.inc'
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
; wraps command line arguments in quotes and launches a target.
|
||||
; TARGET equ 'target_name' must be defined before including this file.
|
||||
; WRAPPER_SUFFIX equ '_wrapper_name' must be defined before including this file.
|
||||
|
||||
include 'KOSfuncs.inc'
|
||||
|
||||
virtual
|
||||
db WRAPPER_SUFFIX
|
||||
SUFFIX_SIZE = $ - $$
|
||||
end virtual
|
||||
|
||||
org 0x0
|
||||
use32
|
||||
|
||||
@@ -12,27 +17,31 @@ dd start
|
||||
dd i_end
|
||||
dd m_end
|
||||
dd m_end
|
||||
dd params
|
||||
dd 0
|
||||
dd path
|
||||
dd target_path
|
||||
|
||||
start:
|
||||
cmp byte [params], 0
|
||||
mov edi, target_path
|
||||
or ecx, -1
|
||||
xor al, al
|
||||
repne scasb
|
||||
|
||||
sub edi, SUFFIX_SIZE + 1
|
||||
mov byte [edi], 0
|
||||
|
||||
cmp byte [path], 0
|
||||
je .launch
|
||||
|
||||
mov esi, params
|
||||
mov ah, '"'
|
||||
mov byte [q_path], '"'
|
||||
|
||||
.shift_loop:
|
||||
mov al, [esi]
|
||||
mov [esi], ah
|
||||
inc esi
|
||||
mov ah, al
|
||||
test al, al
|
||||
jnz .shift_loop
|
||||
mov edi, path
|
||||
or ecx, -1
|
||||
xor al, al
|
||||
repne scasb
|
||||
|
||||
mov word [edi-1], '"'
|
||||
|
||||
mov word [esi], '"'
|
||||
|
||||
mov dword [fi + 8], params
|
||||
mov dword [fi + 8], q_path
|
||||
|
||||
.launch:
|
||||
mov eax, SF_FILE
|
||||
@@ -47,11 +56,14 @@ fi:
|
||||
db 0
|
||||
dd target_path
|
||||
|
||||
target_path db TARGET, 0
|
||||
|
||||
i_end:
|
||||
|
||||
params rb 1024
|
||||
params rb 256
|
||||
virtual at params
|
||||
q_path rb 1
|
||||
path rb 255
|
||||
end virtual
|
||||
|
||||
target_path rb 1024
|
||||
|
||||
m_end:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user