pkgsrc/devel/cscope/patches/patch-ap
ghen f77744e319 When Vim receives a SIGWINCH when its window is resized, it passes the signal
on to cscope when it's running (whether this is correct or not is a different
discussion).  The signal handler in cscope tries to ungetch() which crashes if
cscope is running in line mode (as under Vim) as opposed to under ncurses.

From Philip Paeps <philip@freebsd.org>.  Bump PKGREVISION.
2008-12-17 17:01:15 +00:00

42 lines
1.3 KiB
Text

$NetBSD: patch-ap,v 1.3 2008/12/17 17:01:15 ghen Exp $
--- src/main.c.orig 2008-12-17 11:50:30.000000000 +0100
+++ src/main.c 2008-12-17 11:50:45.000000000 +0100
@@ -128,7 +128,8 @@
(void) sig;
(void) info;
(void) unused;
- ungetch(KEY_RESIZE);
+ if (incurses == YES)
+ ungetch(KEY_RESIZE);
}
#endif
@@ -153,12 +154,7 @@
yyout = stdout;
/* save the command name for messages */
argv0 = argv[0];
-#if defined(KEY_RESIZE) && !defined(__DJGPP__)
- winch_action.sa_sigaction = sigwinch_handler;
- sigemptyset(&winch_action.sa_mask);
- winch_action.sa_flags = SA_SIGINFO;
- sigaction(SIGWINCH,&winch_action,NULL);
-#endif
+
/* set the options */
while (--argc > 0 && (*++argv)[0] == '-') {
/* HBB 20030814: add GNU-style --help and --version options */
@@ -403,6 +399,13 @@
signal(SIGINT, SIG_IGN); /* ignore interrupts */
signal(SIGPIPE, SIG_IGN);/* | command can cause pipe signal */
+#if defined(KEY_RESIZE) && !defined(__DJGPP__)
+ winch_action.sa_sigaction = sigwinch_handler;
+ sigemptyset(&winch_action.sa_mask);
+ winch_action.sa_flags = SA_SIGINFO;
+ sigaction(SIGWINCH,&winch_action,NULL);
+#endif
+
/* initialize the curses display package */
initscr(); /* initialize the screen */
entercurses();