summaryrefslogtreecommitdiff
path: root/www/w3m/patches/patch-ab
blob: ab01146b6a60bc0fe4a0776719548e48ca499d2c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
$NetBSD: patch-ab,v 1.5 2000/05/19 07:34:35 itohy Exp $

Fix problems where:
 1. Suspend the job w3m belongs to, not w3m only.
 2. Automatic creation of ~/.w3m fails.

--- main.c.orig	Fri Apr 21 12:45:53 2000
+++ main.c	Fri May 19 12:40:52 2000
@@ -145,9 +145,8 @@
 
     BookmarkFile = NULL;
     rc_dir = expandName(RC_DIR);
-    i = strlen(rc_dir);
-    if (i > 1 && rc_dir[i] == '/')
-	rc_dir[i] = '\0';
+    for (p = rc_dir + strlen(rc_dir) - 1; p > rc_dir && *p == '/'; p--)
+      *p = '\0';
     config_file = rcFile("config");
 
     /* argument search 1 */
@@ -1427,7 +1426,17 @@
 	shell = "/bin/sh";
     system(shell);
 #else				/* SIGSTOP */
+#ifdef SIGTSTP	/* BSD */
+    signal(SIGTSTP, SIG_DFL);	/* just in case */
+    /*
+     * Note: If susp() was called from SIGTSTP handler,
+     *	unblocking SIGTSTP would be required here.
+     *	Currently not.
+     */
+    kill(0, SIGTSTP);	/* stop whole job, not a single process */
+#else
     kill(getpid(), SIGSTOP);
+#endif
 #endif				/* SIGSTOP */
     fmInit();
     displayBuffer(Currentbuf, B_FORCE_REDRAW);