[Gd-chatter] r10735 - trunk/fundev/sources/lib/jam

housel at gwydiondylan.org housel at gwydiondylan.org
Sun May 14 17:58:33 CEST 2006


Author: housel
Date: Sun May 14 17:58:31 2006
New Revision: 10735

Modified:
   trunk/fundev/sources/lib/jam/jam-evaluator.dylan
Log:
Bug: 7003
Expand $(var:@) as an empty sequence when var is empty rather than creating
an empty file.

* fundev/sources/lib/jam/jam-evaluator.dylan (jam-expand-arg-colon):
  When expanding the '@' modifier, Check for empty variable contents
  and return an empty sequence instead of creating an empty response
  file and returning its filename.


Modified: trunk/fundev/sources/lib/jam/jam-evaluator.dylan
==============================================================================
--- trunk/fundev/sources/lib/jam/jam-evaluator.dylan	(original)
+++ trunk/fundev/sources/lib/jam/jam-evaluator.dylan	Sun May 14 17:58:31 2006
@@ -187,17 +187,21 @@
         vector(result)
       end for
     elseif (modifier == '@')
-      let (stream :: <file-stream>, locator :: <file-locator>)
-        = jam-new-temporary-file(jam);
-      block ()
-        for (component in contents)
-          write(stream, component);
-          new-line(stream);
-        end for;
-      cleanup
-        close(stream);
-      end;
-      vector(as(<byte-string>, locator))
+      if (empty?(contents))
+        #[]
+      else
+        let (stream :: <file-stream>, locator :: <file-locator>)
+          = jam-new-temporary-file(jam);
+        block ()
+          for (component in contents)
+            write(stream, component);
+            new-line(stream);
+          end for;
+        cleanup
+          close(stream);
+        end;
+        vector(as(<byte-string>, locator))
+      end if
     else
       let func =
         select (modifier)



More information about the chatter mailing list