File: 0002-PH-fix-support.c.patch

package info (click to toggle)
libident 0.32-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,464 kB
  • sloc: sh: 8,260; ansic: 840; makefile: 27
file content (45 lines) | stat: -rw-r--r-- 1,061 bytes parent folder | download | duplicates (3)
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
39
40
41
42
43
44
45
From: Boyuan Yang <byang@debian.org>
Date: Sun, 2 Jan 2022 14:17:45 -0500
Subject: PH fix support.c

---
 support.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/support.c b/support.c
index de1e48b..8afabfd 100644
--- a/support.c
+++ b/support.c
@@ -3,6 +3,7 @@
 **
 ** Author: Pr Emanuelsson <pell@lysator.liu.se>
 ** Hacked by: Peter Eriksson <pen@lysator.liu.se>
+** Also by: Philip Hazel <ph10@cus.cam.ac.uk>
 */
 #include <stdio.h>
 #include <ctype.h>
@@ -46,13 +47,13 @@ char *id_strtok (char *cp, char *cs, char *dc)
     {
 	while (*bp)
 	    bp++;
-	return cs;
+	return cp;  /* Fix by PH - was "return cs" */
     }
     
     /*
     ** Skip leading spaces
     */
-    while (isspace(*bp))
+    while (isspace((unsigned char)*bp))
 	bp++;
     
     /*
@@ -69,7 +70,7 @@ char *id_strtok (char *cp, char *cs, char *dc)
     ** Remove trailing spaces
     */
     *dc = *bp;
-    for (dc = bp-1; dc > cp && isspace(*dc); dc--)
+    for (dc = bp-1; dc > cp && isspace((unsigned char)*dc); dc--)
 	;
     *++dc = '\0';