Show
Ignore:
Timestamp:
10/09/07 20:56:52 (1 year ago)
Author:
Rafaël Carré <funman@videolan.org>
git-committer:
Rafaël Carré <funman@videolan.org> 1189450612 +0000
git-parent:

[3305b049e7f587b23359a1c9047fb5763d19c1dc]

git-author:
Rafaël Carré <funman@videolan.org> 1189450612 +0000
Message:

Removes trailing spaces. Removes tabs.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • lxdialog/lxdialog.c

    re5d7794 r6ee1e19  
    6868#endif 
    6969    if (argc < 2) { 
    70    Usage (argv[0]); 
    71    exit (-1); 
    72     } 
    73  
    74     while (offset < argc - 1 && !end_common_opts) {    /* Common options */ 
    75    if (!strcmp (argv[offset + 1], "--title")) { 
    76        if (argc - offset < 3 || title != NULL) { 
    77        Usage (argv[0]); 
    78        exit (-1); 
    79        } else { 
    80        title = argv[offset + 2]; 
    81        offset += 2; 
    82        } 
     70    Usage (argv[0]); 
     71    exit (-1); 
     72    } 
     73 
     74    while (offset < argc - 1 && !end_common_opts) {    /* Common options */ 
     75    if (!strcmp (argv[offset + 1], "--title")) { 
     76        if (argc - offset < 3 || title != NULL) { 
     77        Usage (argv[0]); 
     78        exit (-1); 
     79        } else { 
     80        title = argv[offset + 2]; 
     81        offset += 2; 
     82        } 
    8383        } else if (!strcmp (argv[offset + 1], "--backtitle")) { 
    8484            if (backtitle != NULL) { 
     
    8989                offset += 2; 
    9090            } 
    91    } else if (!strcmp (argv[offset + 1], "--clear")) { 
    92        if (clear_screen) { /* Hey, "--clear" can't appear twice! */ 
    93        Usage (argv[0]); 
    94        exit (-1); 
    95        } else if (argc == 2) { /* we only want to clear the screen */ 
    96        init_dialog (); 
    97        refresh (); /* init_dialog() will clear the screen for us */ 
    98        end_dialog (); 
    99        return 0; 
    100        } else { 
    101        clear_screen = 1; 
    102        offset++; 
    103        } 
    104    } else          /* no more common options */ 
    105        end_common_opts = 1; 
    106     } 
    107  
    108     if (argc - 1 == offset) {  /* no more options */ 
    109    Usage (argv[0]); 
    110    exit (-1); 
     91    } else if (!strcmp (argv[offset + 1], "--clear")) { 
     92        if (clear_screen) {    /* Hey, "--clear" can't appear twice! */ 
     93        Usage (argv[0]); 
     94        exit (-1); 
     95        } else if (argc == 2) {    /* we only want to clear the screen */ 
     96        init_dialog (); 
     97        refresh ();    /* init_dialog() will clear the screen for us */ 
     98        end_dialog (); 
     99        return 0; 
     100        } else { 
     101        clear_screen = 1; 
     102        offset++; 
     103        } 
     104    } else            /* no more common options */ 
     105        end_common_opts = 1; 
     106    } 
     107 
     108    if (argc - 1 == offset) {    /* no more options */ 
     109    Usage (argv[0]); 
     110    exit (-1); 
    111111    } 
    112112    /* use a table to look for the requested mode, to avoid code duplication */ 
    113113 
    114     for (modePtr = modes; modePtr->name; modePtr++)    /* look for the mode */ 
    115    if (!strcmp (argv[offset + 1], modePtr->name)) 
    116        break; 
     114    for (modePtr = modes; modePtr->name; modePtr++)    /* look for the mode */ 
     115    if (!strcmp (argv[offset + 1], modePtr->name)) 
     116        break; 
    117117 
    118118    if (!modePtr->name) 
    119    Usage (argv[0]); 
     119    Usage (argv[0]); 
    120120    if (argc - offset < modePtr->argmin) 
    121    Usage (argv[0]); 
     121    Usage (argv[0]); 
    122122    if (modePtr->argmax && argc - offset > modePtr->argmax) 
    123    Usage (argv[0]); 
     123    Usage (argv[0]); 
    124124 
    125125 
     
    128128    retval = (*(modePtr->jumper)) (title, argc - offset, argv + offset); 
    129129 
    130     if (clear_screen) {        /* clear screen before exit */ 
    131    attr_clear (stdscr, LINES, COLS, screen_attr); 
    132    refresh (); 
     130    if (clear_screen) {        /* clear screen before exit */ 
     131    attr_clear (stdscr, LINES, COLS, screen_attr); 
     132    refresh (); 
    133133    } 
    134134    end_dialog(); 
     
    174174{ 
    175175    return dialog_menu (t, av[2], atoi (av[3]), atoi (av[4]), 
    176            atoi (av[5]), av[6], (ac - 6) / 2, av + 7); 
     176            atoi (av[5]), av[6], (ac - 6) / 2, av + 7); 
    177177} 
    178178 
     
    181181{ 
    182182    return dialog_checklist (t, av[2], atoi (av[3]), atoi (av[4]), 
    183    atoi (av[5]), (ac - 6) / 3, av + 6, FLAG_CHECK); 
     183    atoi (av[5]), (ac - 6) / 3, av + 6, FLAG_CHECK); 
    184184} 
    185185 
     
    188188{ 
    189189    return dialog_checklist (t, av[2], atoi (av[3]), atoi (av[4]), 
    190    atoi (av[5]), (ac - 6) / 3, av + 6, FLAG_RADIO); 
     190    atoi (av[5]), (ac - 6) / 3, av + 6, FLAG_RADIO); 
    191191} 
    192192