Skip to content
This repository has been archived by the owner on Jun 9, 2018. It is now read-only.

Commit

Permalink
use .STAT_EXISTS
Browse files Browse the repository at this point in the history
  • Loading branch information
fperrad committed Mar 16, 2009
1 parent 58a5a8e commit 5087a18
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/lib/luapackage.pir
Expand Up @@ -108,6 +108,8 @@ LIST
package[$P1] = $P0
.end

.include 'stat.pasm'

.sub 'findfile' :anon
.param string name
.param string pname
Expand All @@ -133,7 +135,7 @@ LIST
if tmpl == '' goto L3
.local string filename
filename = lua_gsub(tmpl, '?', name)
$I0 = stat filename, 0
$I0 = stat filename, .STAT_EXISTS
unless $I0 goto L4
.return (filename)
L4:
Expand Down Expand Up @@ -224,8 +226,8 @@ LIST
new $P0, 'LuaString'
.return ($P0)
L1:
$S0 = substr name, 0, $I0
(filename, $P0) = findfile($S1, 'pbcpath')
$S0 = substr $S1, 0, $I0
(filename, $P0) = findfile($S0, 'pbcpath')
unless filename == '' goto L2
# root not found
.return ($P0)
Expand Down

0 comments on commit 5087a18

Please sign in to comment.