/[cvs]/joko/Uni/BSArch/03/win32/min_shell.c
ViewVC logotype

Diff of /joko/Uni/BSArch/03/win32/min_shell.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by joko, Thu Jun 15 23:09:44 2006 UTC revision 1.9 by joko, Thu Jun 15 23:16:01 2006 UTC
# Line 33  void run_commands(FILE * fp) { Line 33  void run_commands(FILE * fp) {
33    char command[MAX_COMMAND_LENGTH];    char command[MAX_COMMAND_LENGTH];
34        
35    while (fgets(command, MAX_COMMAND_LENGTH, fp)) {    while (fgets(command, MAX_COMMAND_LENGTH, fp)) {
36        int command_length;
37        
38        // strip newlines
39      chomp(command);      chomp(command);
40        
41        // ... and action
42      execute_command(command);      execute_command(command);
43    }    }
44        
# Line 41  void run_commands(FILE * fp) { Line 46  void run_commands(FILE * fp) {
46    
47    
48  void execute_command(char * command) {  void execute_command(char * command) {
49    
50      BOOL background = FALSE;
51      int command_length;
52    
53    printf("process_command: %s\n", command);    printf("process_command: %s\n", command);
54    os_start_process(command, 0);    
55      // background or foreground?
56      command_length = strlen(command);
57      if (command[command_length-1] == '&') {
58        command[command_length-1] = '\0';
59        background = TRUE;
60      }
61      
62      os_start_process(command, background);
63  }  }
64    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

MailToCvsAdmin">MailToCvsAdmin
ViewVC Help
Powered by ViewVC 1.1.26 RSS 2.0 feed