Mercurial > hg > early-roguelike
comparison rogue5/mdport.c @ 291:5b6855d5d089
Fix a portability issue with md_hasclreol().
Some games' implementation of md_hasclreol() poked around in ncurses
internals, which does not work for some ncurses build configuration.
Most games did not actually call md_hasclreol(), so it was removed.
There is a standard terminfo function which can retrieve the value of
the clr_eol capability, so this was used for rogue5.
| author | John "Elwin" Edwards | 
|---|---|
| date | Wed, 27 Dec 2017 10:26:06 -0500 | 
| parents | 8b6aba552f6f | 
| children | 
   comparison
  equal
  deleted
  inserted
  replaced
| 290:2b452dbf0138 | 291:5b6855d5d089 | 
|---|---|
| 261 } | 261 } | 
| 262 | 262 | 
| 263 int | 263 int | 
| 264 md_hasclreol(void) | 264 md_hasclreol(void) | 
| 265 { | 265 { | 
| 266 #if defined(clr_eol) | |
| 267 #ifdef NCURSES_VERSION | 266 #ifdef NCURSES_VERSION | 
| 267 char *cap_str; | |
| 268 if (cur_term == NULL) | 268 if (cur_term == NULL) | 
| 269 return(0); | 269 return(0); | 
| 270 if (cur_term->type.Strings == NULL) | 270 cap_str = tigetstr("el"); | 
| 271 return(0); | 271 return (cap_str != NULL); | 
| 272 #endif | 272 #elif defined(clr_eol) | 
| 273 return((clr_eol != NULL) && (*clr_eol != 0)); | 273 return((clr_eol != NULL) && (*clr_eol != 0)); | 
| 274 #elif defined(__PDCURSES__) | 274 #elif defined(__PDCURSES__) | 
| 275 return(TRUE); | 275 return(TRUE); | 
| 276 #else | 276 #else | 
| 277 return((CE != NULL) && (*CE != 0)); | 277 return((CE != NULL) && (*CE != 0)); | 
