Skip to content
This repository
Browse code

As a convenience, the system operator concatenates its arguments

  • Loading branch information...
commit 806d8f6621d1a74af7eff541fea869eb0fda491a 1 parent 8226890
Tim Burks authored

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. 7  objc/Nu.m
7  objc/Nu.m
@@ -8676,7 +8676,12 @@ @interface Nu_system_operator : NuOperator {}
8676 8676
 @implementation Nu_system_operator
8677 8677
 - (id) callWithArguments:(id)cdr context:(NSMutableDictionary *)context
8678 8678
 {
8679  
-    id command = [[cdr car] evalWithContext:context];
  8679
+    id cursor = cdr;
  8680
+    NSMutableString *command = [NSMutableString string];
  8681
+    while (cursor && (cursor != [NSNull null])) {
  8682
+        [command appendString:[[[cursor car] evalWithContext:context] stringValue]];        
  8683
+        cursor = [cursor cdr];
  8684
+    }
8680 8685
     const char *commandString = [[command stringValue] cStringUsingEncoding:NSUTF8StringEncoding];
8681 8686
     int result = system(commandString) >> 8;      // this needs an explanation
8682 8687
     return [NSNumber numberWithInt:result];

0 notes on commit 806d8f6

Please sign in to comment.
Something went wrong with that request. Please try again.