diff options
| author | Karl Heuer | 1996-01-09 23:44:41 +0000 |
|---|---|---|
| committer | Karl Heuer | 1996-01-09 23:44:41 +0000 |
| commit | f21b7e242cfe7f4fa0aceb031da1c6bebf427abf (patch) | |
| tree | 4a08dd14ecf9a1853dd0318b494360060b4ddecd /src/termcap.c | |
| parent | 4a127b3b175c83d38b7cdb713e144965d75c091f (diff) | |
| download | emacs-f21b7e242cfe7f4fa0aceb031da1c6bebf427abf.tar.gz emacs-f21b7e242cfe7f4fa0aceb031da1c6bebf427abf.zip | |
(tgetent): Find all the tc caps that there are.
Diffstat (limited to 'src/termcap.c')
| -rw-r--r-- | src/termcap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/termcap.c b/src/termcap.c index 26a12290778..2b0277874ba 100644 --- a/src/termcap.c +++ b/src/termcap.c | |||
| @@ -423,7 +423,7 @@ tgetent (bp, name) | |||
| 423 | register int fd; | 423 | register int fd; |
| 424 | struct buffer buf; | 424 | struct buffer buf; |
| 425 | register char *bp1; | 425 | register char *bp1; |
| 426 | char *bp2; | 426 | char *tc_search_point; |
| 427 | char *term; | 427 | char *term; |
| 428 | int malloc_size = 0; | 428 | int malloc_size = 0; |
| 429 | register int c; | 429 | register int c; |
| @@ -511,7 +511,7 @@ tgetent (bp, name) | |||
| 511 | malloc_size = indirect ? strlen (tcenv) + 1 : buf.size; | 511 | malloc_size = indirect ? strlen (tcenv) + 1 : buf.size; |
| 512 | bp = (char *) xmalloc (malloc_size); | 512 | bp = (char *) xmalloc (malloc_size); |
| 513 | } | 513 | } |
| 514 | bp1 = bp; | 514 | tc_search_point = bp1 = bp; |
| 515 | 515 | ||
| 516 | if (indirect) | 516 | if (indirect) |
| 517 | /* Copy the data from the environment variable. */ | 517 | /* Copy the data from the environment variable. */ |
| @@ -542,11 +542,10 @@ tgetent (bp, name) | |||
| 542 | malloc_size = bp1 - bp + buf.size; | 542 | malloc_size = bp1 - bp + buf.size; |
| 543 | termcap_name = (char *) xrealloc (bp, malloc_size); | 543 | termcap_name = (char *) xrealloc (bp, malloc_size); |
| 544 | bp1 += termcap_name - bp; | 544 | bp1 += termcap_name - bp; |
| 545 | tc_search_point += termcap_name - bp; | ||
| 545 | bp = termcap_name; | 546 | bp = termcap_name; |
| 546 | } | 547 | } |
| 547 | 548 | ||
| 548 | bp2 = bp1; | ||
| 549 | |||
| 550 | /* Copy the line of the entry from buf into bp. */ | 549 | /* Copy the line of the entry from buf into bp. */ |
| 551 | termcap_name = buf.ptr; | 550 | termcap_name = buf.ptr; |
| 552 | while ((*bp1++ = c = *termcap_name++) && c != '\n') | 551 | while ((*bp1++ = c = *termcap_name++) && c != '\n') |
| @@ -560,7 +559,8 @@ tgetent (bp, name) | |||
| 560 | 559 | ||
| 561 | /* Does this entry refer to another terminal type's entry? | 560 | /* Does this entry refer to another terminal type's entry? |
| 562 | If something is found, copy it into heap and null-terminate it. */ | 561 | If something is found, copy it into heap and null-terminate it. */ |
| 563 | term = tgetst1 (find_capability (bp2, "tc"), (char **) 0); | 562 | tc_search_point = find_capability (tc_search_point, "tc"); |
| 563 | term = tgetst1 (tc_search_point, (char **) 0); | ||
| 564 | } | 564 | } |
| 565 | 565 | ||
| 566 | close (fd); | 566 | close (fd); |