Fossil SCM

Patch to linenoise.c to get it to compile on SunOS.

drh 2015-06-30 15:17 UTC trunk
Commit 52e1f54bba9c7007048d50199b3430effba138dc
1 file changed +2
--- src/linenoise.c
+++ src/linenoise.c
@@ -281,10 +281,11 @@
281281
}
282282
283283
/* Try to get the number of columns in the current terminal, or assume 80
284284
* if it fails. */
285285
static int getColumns(int ifd, int ofd) {
286
+#if !defined(__sun__)
286287
struct winsize ws;
287288
288289
if (ioctl(1, TIOCGWINSZ, &ws) == -1 || ws.ws_col == 0) {
289290
/* ioctl() failed. Try to query the terminal itself. */
290291
int start, cols;
@@ -310,10 +311,11 @@
310311
} else {
311312
return ws.ws_col;
312313
}
313314
314315
failed:
316
+#endif
315317
return 80;
316318
}
317319
318320
/* Clear the screen. Used to handle ctrl+l */
319321
void linenoiseClearScreen(void) {
320322
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button