Changeset 121

Show
Ignore:
Timestamp:
18.12.2006 18:17:42 (2 years ago)
Author:
decoder
Message:

Fixed small bug in Misc.pm patch

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/devel/FuzzyOcr/Misc.pm

    r120 r121  
    8181    # bugs), let's be explicit that we require a specified file descriptor 
    8282    defined POSIX::dup2($fd_got,$fd_target) 
    83       or "Can't dup2 from $fd_got to $fd_target: $!"; 
     83      or die "Can't dup2 from $fd_got to $fd_target: $!"; 
    8484    if ($fd_got > 2) {  # let's get rid of the original fd, unless 0,1,2 
    8585      my($err); defined POSIX::close($fd_got) or $err = $!; 
     
    9494    my $t = get_timeout(); 
    9595    my ($cmd, $stdin, $stdout, $stderr, $return_stdout) = @_; 
    96     my ($pgm,undef) = split(' ',$cmd,2); 
     96    my ($pgm,@args) = split(' ',$cmd); 
    9797    $stdout = '>/dev/null' unless $stdout; 
    9898    $stderr = '>/dev/null' unless $stderr; 
     
    123123                open_on_specific_fd(2, $stderr); 
    124124            } 
    125             exec($cmd); 
     125            exec {$pgm} ($pgm,@args); 
    126126            die "failed to exec $cmd: $!"; 
    127127          }; 
     
    170170                    open_on_specific_fd(2, $stderr); 
    171171                } 
    172                 exec($cmd); 
     172                exec {$pgm} ($pgm,@args); 
    173173                die "failed to exec $cmd: $!"; 
    174174              };