Don't abort if embryo_cc's return code is 1.
[redact.git] / lib / redact / app.rb
index 72175162e2424c86930db4166b8ab19d9c30246a..dc9ef9b52b4d52bb8fb8697e0a0cd1f26c452eeb 100644 (file)
@@ -1,5 +1,5 @@
 #--
-# $Id: app.rb 7 2005-03-28 16:27:18Z tilman $
+# $Id: app.rb 39 2005-04-28 21:08:11Z tilman $
 #
 # Copyright (c) 2005 Tilman Sauerbeck (tilman at code-monkey de)
 #
@@ -135,7 +135,8 @@ module Redact
                                                c = "embryo_cc " +
                                                    "-i #{incl}/include " +
                                                    "-o #{tf_out.path} #{tf_in.path}"
-                                               unless system(c)
+                                               system(c)
+                                               unless (0..1).include?($?.exitstatus)
                                                        raise("Cannot compile Embryo code")
                                                end
 
@@ -206,7 +207,7 @@ EOT
                                method = (sane == @filename) ? :unshift : :push
                                s.send(method, SourceFile.new(sane, value.join))
 
-                               # include files that are with File.read, too
+                               # include files that are read with File.read, too
                                value.join.grep(/File\.read\(\"(.+)\"\)/) do
                                        sane = Pathname.new($1).cleanpath.to_s
                                        s << SourceFile.new(sane, File.read(sane))