Changeset 7422 for code/trunk/src/libraries/core/command
- Timestamp:
- Sep 12, 2010, 7:55:04 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/command/IOConsolePOSIX.cc
r7287 r7422 319 319 void IOConsole::getTerminalSize() 320 320 { 321 this->terminalWidth_ = 0; 322 this->terminalHeight_ = 0; 323 321 324 #ifdef TIOCGSIZE 322 325 struct ttysize win; … … 325 328 this->terminalWidth_ = win.ts_cols; 326 329 this->terminalHeight_ = win.ts_lines; 327 return;328 330 } 329 331 #elif defined TIOCGWINSZ … … 333 335 this->terminalWidth_ = win.ws_col; 334 336 this->terminalHeight_ = win.ws_row; 335 return; 336 } 337 #else 338 const char* s = getenv("COLUMNS"); 339 this->terminalWidth_ = s ? strtol(s, NULL, 10) : 80; 340 s = getenv("LINES"); 341 this->terminalHeight_ = s ? strtol(s, NULL, 10) : 24; 342 return; 337 } 343 338 #endif 344 this->terminalWidth_ = 80; 345 this->terminalHeight_ = 24; 339 340 const char* s; 341 if (!this->terminalWidth_ && (s = getenv("COLUMNS"))) 342 this->terminalWidth_ = strtol(s, NULL, 10); 343 if (!this->terminalWidth_) 344 this->terminalWidth_ = 80; 345 if (!this->terminalHeight_ && (s = getenv("LINES"))) 346 this->terminalHeight_ = strtol(s, NULL, 10); 347 if (!this->terminalHeight_) 348 this->terminalHeight_ = 24; 346 349 } 347 350
Note: See TracChangeset
for help on using the changeset viewer.