diff options
| author | Mikhail Osipov <mike.osipov@gmail.com> | 2019-10-04 15:59:15 +0300 |
|---|---|---|
| committer | Mikhail Osipov <mike.osipov@gmail.com> | 2019-10-04 15:59:15 +0300 |
| commit | 2f90e851f14bb23046f40d9d90fefffce854939a (patch) | |
| tree | 1b663950c2861e00ba6c49c90110ea683c5203e6 /main.s | |
| parent | 2d8db366a571bfb191f09f455c8979b23da8ae14 (diff) | |
special files check fix
Diffstat (limited to 'main.s')
| -rw-r--r-- | main.s | 18 |
1 files changed, 14 insertions, 4 deletions
@@ -118,18 +118,23 @@ _start: movl 16(%esp), %eax andl $S_IFMT, %eax - subl $S_IFDIR, %eax - testl %eax, %eax + testl $S_IFDIR, %eax jnz 1f + testl $S_IFREG, %eax + jnz 2f + + movl $1, (binary) + jmp 2f + 1: pushl $0 pushl $str_fnot pushl 8(%ebp) call print_strings jmp restore - 1: - addl $(64 - 6), %esp + 2: + addl $(128 - 6), %esp # test if stdin refers to linux console @@ -364,6 +369,10 @@ read_next: .charloop: lodsb + + testl $1, (binary) + jnz 1f + cmpb $0x0a, %al jne 1f @@ -1027,3 +1036,4 @@ timespec: .comm pollfd, 8 .comm child_pid, 4 .comm pause, 4 +.comm binary, 4 |
