Fossil SCM
Patch to linenoise.c to get it to compile on SunOS.
Commit
52e1f54bba9c7007048d50199b3430effba138dc
Parent
63fc62d9ecfa141…
1 file changed
+2
+2
| --- src/linenoise.c | ||
| +++ src/linenoise.c | ||
| @@ -281,10 +281,11 @@ | ||
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | /* Try to get the number of columns in the current terminal, or assume 80 |
| 284 | 284 | * if it fails. */ |
| 285 | 285 | static int getColumns(int ifd, int ofd) { |
| 286 | +#if !defined(__sun__) | |
| 286 | 287 | struct winsize ws; |
| 287 | 288 | |
| 288 | 289 | if (ioctl(1, TIOCGWINSZ, &ws) == -1 || ws.ws_col == 0) { |
| 289 | 290 | /* ioctl() failed. Try to query the terminal itself. */ |
| 290 | 291 | int start, cols; |
| @@ -310,10 +311,11 @@ | ||
| 310 | 311 | } else { |
| 311 | 312 | return ws.ws_col; |
| 312 | 313 | } |
| 313 | 314 | |
| 314 | 315 | failed: |
| 316 | +#endif | |
| 315 | 317 | return 80; |
| 316 | 318 | } |
| 317 | 319 | |
| 318 | 320 | /* Clear the screen. Used to handle ctrl+l */ |
| 319 | 321 | void linenoiseClearScreen(void) { |
| 320 | 322 |
| --- src/linenoise.c | |
| +++ src/linenoise.c | |
| @@ -281,10 +281,11 @@ | |
| 281 | } |
| 282 | |
| 283 | /* Try to get the number of columns in the current terminal, or assume 80 |
| 284 | * if it fails. */ |
| 285 | static int getColumns(int ifd, int ofd) { |
| 286 | struct winsize ws; |
| 287 | |
| 288 | if (ioctl(1, TIOCGWINSZ, &ws) == -1 || ws.ws_col == 0) { |
| 289 | /* ioctl() failed. Try to query the terminal itself. */ |
| 290 | int start, cols; |
| @@ -310,10 +311,11 @@ | |
| 310 | } else { |
| 311 | return ws.ws_col; |
| 312 | } |
| 313 | |
| 314 | failed: |
| 315 | return 80; |
| 316 | } |
| 317 | |
| 318 | /* Clear the screen. Used to handle ctrl+l */ |
| 319 | void linenoiseClearScreen(void) { |
| 320 |
| --- src/linenoise.c | |
| +++ src/linenoise.c | |
| @@ -281,10 +281,11 @@ | |
| 281 | } |
| 282 | |
| 283 | /* Try to get the number of columns in the current terminal, or assume 80 |
| 284 | * if it fails. */ |
| 285 | static int getColumns(int ifd, int ofd) { |
| 286 | #if !defined(__sun__) |
| 287 | struct winsize ws; |
| 288 | |
| 289 | if (ioctl(1, TIOCGWINSZ, &ws) == -1 || ws.ws_col == 0) { |
| 290 | /* ioctl() failed. Try to query the terminal itself. */ |
| 291 | int start, cols; |
| @@ -310,10 +311,11 @@ | |
| 311 | } else { |
| 312 | return ws.ws_col; |
| 313 | } |
| 314 | |
| 315 | failed: |
| 316 | #endif |
| 317 | return 80; |
| 318 | } |
| 319 | |
| 320 | /* Clear the screen. Used to handle ctrl+l */ |
| 321 | void linenoiseClearScreen(void) { |
| 322 |