summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xshbin4688 -> 4664 bytes
-rw-r--r--sh.asm32
-rw-r--r--sh.obin4912 -> 4880 bytes
3 files changed, 11 insertions, 21 deletions
diff --git a/sh b/sh
index f1a78d3..c41dcb8 100755
--- a/sh
+++ b/sh
Binary files differ
diff --git a/sh.asm b/sh.asm
index a1dc0be..0c5d707 100644
--- a/sh.asm
+++ b/sh.asm
@@ -154,27 +154,17 @@ _parse_path2:
; Reads the PATH variable
_pathfinder:
inc r8
- xor rax, rax
- mov byte al, [r8]
- cmp al, `P`
- jne _pathfinder
- mov byte al, [r8+1]
- cmp al, `A`
- jne _pathfinder
- mov byte al, [r8+2]
- cmp al, `T`
- jne _pathfinder
- mov byte al, [r8+3]
- cmp al, `H`
- jne _pathfinder
- mov byte al, [r8+4]
- cmp al, `=`
- jne _pathfinder
- mov byte al, [r8+5]
- cmp al, `"`
- jne _pathfinder
- test al, al ;checks for 0
- je _quit
+
+ ;Check that we've found the PATH variable
+ mov r10, `\0\0PATH="`
+ mov rax, [r8]
+ shl rax, 16
+ cmp rax,r10
+ jne _pathfinder ;if we haven't, let's move right one and see if it's there
+ shr rax, 56
+ test al, al ;checks for a null terminator after 'PATH='
+ jz _quit
+
add r8, 0x6
mov r10, 0x1
push 0x0
diff --git a/sh.o b/sh.o
index d628f83..1487269 100644
--- a/sh.o
+++ b/sh.o
Binary files differ