~ubuntu-branches/ubuntu/precise/xterm/precise-updates

« back to all changes in this revision

Viewing changes to main.c

  • Committer: Bazaar Package Importer
  • Author(s): Lorenzo De Liso
  • Date: 2011-02-12 15:58:09 UTC
  • mfrom: (1.5.3 upstream)
  • mto: This revision was merged to the branch mainline in revision 33.
  • Revision ID: james.westby@ubuntu.com-20110212155809-vxve6aexyvm7aoh3
Tags: upstream-268
ImportĀ upstreamĀ versionĀ 268

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $XTermId: main.c,v 1.618 2010/06/20 21:11:51 tom Exp $ */
 
1
/* $XTermId: main.c,v 1.620 2011/02/09 10:13:32 tom Exp $ */
2
2
 
3
3
/*
4
4
 *                               W A R N I N G
15
15
 
16
16
/***********************************************************
17
17
 
18
 
Copyright 2002-2009,2010 by Thomas E. Dickey
 
18
Copyright 2002-2010,2011 by Thomas E. Dickey
19
19
 
20
20
                        All Rights Reserved
21
21
 
1753
1753
    int mode;
1754
1754
    char *my_class = DEFCLASS;
1755
1755
    Window winToEmbedInto = None;
1756
 
#if OPT_COLOR_RES
1757
 
    Bool reversed = False;
1758
 
#endif
1759
1756
 
1760
1757
    ProgramName = argv[0];
1761
1758
 
1826
1823
                }
1827
1824
                unique = 3;
1828
1825
            } else {
1829
 
#if OPT_COLOR_RES
1830
 
                if (abbrev(argv[n], "-reverse", (size_t) 2)
1831
 
                    || !strcmp("-rv", argv[n])) {
1832
 
                    reversed = True;
1833
 
                } else if (!strcmp("+rv", argv[n])) {
1834
 
                    reversed = False;
1835
 
                }
1836
 
#endif
1837
1826
                quit = False;
1838
1827
                unique = 3;
1839
1828
            }
2388
2377
                        winToEmbedInto, 0, 0);
2389
2378
    }
2390
2379
#if OPT_COLOR_RES
2391
 
    TRACE(("checking resource values rv %s fg %s, bg %s\n",
2392
 
           BtoS(term->misc.re_verse0),
 
2380
    TRACE(("checking reverseVideo before rv %s fg %s, bg %s\n",
 
2381
           term->misc.re_verse0 ? "reverse" : "normal",
2393
2382
           NonNull(TScreenOf(term)->Tcolors[TEXT_FG].resource),
2394
2383
           NonNull(TScreenOf(term)->Tcolors[TEXT_BG].resource)));
2395
2384
 
2396
 
    if ((reversed && term->misc.re_verse0)
2397
 
        && ((TScreenOf(term)->Tcolors[TEXT_FG].resource
2398
 
             && !isDefaultForeground(TScreenOf(term)->Tcolors[TEXT_FG].resource))
2399
 
            || (TScreenOf(term)->Tcolors[TEXT_BG].resource
2400
 
                && !isDefaultBackground(TScreenOf(term)->Tcolors[TEXT_BG].resource))
2401
 
        ))
2402
 
        ReverseVideo(term);
 
2385
    if (term->misc.re_verse0) {
 
2386
        if (isDefaultForeground(TScreenOf(term)->Tcolors[TEXT_FG].resource)
 
2387
            && isDefaultBackground(TScreenOf(term)->Tcolors[TEXT_BG].resource)) {
 
2388
            TScreenOf(term)->Tcolors[TEXT_FG].resource = x_strdup(XtDefaultBackground);
 
2389
            TScreenOf(term)->Tcolors[TEXT_BG].resource = x_strdup(XtDefaultForeground);
 
2390
        } else {
 
2391
            ReverseVideo(term);
 
2392
        }
 
2393
        term->misc.re_verse = True;
 
2394
        update_reversevideo();
 
2395
        TRACE(("updated  reverseVideo after  rv %s fg %s, bg %s\n",
 
2396
               term->misc.re_verse ? "reverse" : "normal",
 
2397
               NonNull(TScreenOf(term)->Tcolors[TEXT_FG].resource),
 
2398
               NonNull(TScreenOf(term)->Tcolors[TEXT_BG].resource)));
 
2399
    }
2403
2400
#endif /* OPT_COLOR_RES */
2404
2401
 
2405
2402
#if OPT_MAXIMIZE
3333
3330
        initial_erase = ttymodelist[XTTYMODE_erase].value;
3334
3331
        setInitialErase = True;
3335
3332
    } else if (resource.ptyInitialErase) {
3336
 
        ;
 
3333
        /* EMPTY */ ;
3337
3334
    } else if (ok_termcap) {
3338
3335
        char *s = get_tcap_erase(xw);
3339
3336
        TRACE(("...extracting initial_erase value from termcap\n"));
3545
3542
#endif /* __MVS__ */
3546
3543
                    }
3547
3544
 
3548
 
                    while (1) {
 
3545
                    for (;;) {
3549
3546
#if USE_NO_DEV_TTY
3550
3547
                        if (!no_dev_tty
3551
3548
                            && (ttyfd = open("/dev/tty", O_RDWR)) >= 0) {
4921
4918
    int count = 0;
4922
4919
 
4923
4920
    TRACE(("parse_tty_modes\n"));
4924
 
    while (1) {
 
4921
    for (;;) {
4925
4922
        size_t len;
4926
4923
 
4927
4924
        while (*s && isascii(CharOf(*s)) && isspace(CharOf(*s)))