Ignore:
Timestamp:
Jun 15, 2008 8:09:08 PM (6 years ago)
Author:
pterjan
Message:
  • Fix behavior with no parameter
File:
1 edited

Legend:

Unmodified
Added
Removed
  • neercs/trunk/src/main.c

    r2431 r2433  
    4343    struct screen_list *screen_list = NULL; 
    4444    char *default_shell = NULL; 
    45     int i, w, h; 
     45    int i, w, h, args; 
    4646    int eof = 0, refresh = 1, command = 0; 
    4747 
    4848    default_shell = getenv("SHELL"); 
    4949 
    50     if(default_shell == NULL  && argc < 2) 
     50    args = argc -1; 
     51    if(default_shell == NULL  && args <= 0) 
    5152    { 
    5253        fprintf(stderr, "Environment variable SHELL not set and no arguments given. kthxbye.\n"); 
    5354        return -1; 
    5455    } 
     56 
     57    if(args==0) 
     58        args = 1; 
    5559 
    5660    /* Create main canvas and associated caca window */ 
     
    9094    screen_list->pty = screen_list->prevpty = 0; 
    9195 
    92     for(i = 0; i < argc-1; i++) 
     96    for(i = 0; i < args; i++) 
    9397    { 
    9498        struct screen *tmp; 
Note: See TracChangeset for help on using the changeset viewer.