diff options
author | joda <joda> | 2000-12-30 00:19:04 +0000 |
---|---|---|
committer | joda <joda> | 2000-12-30 00:19:04 +0000 |
commit | f49ce4666ac939cd901f7ad0f8f06bd437b9457b (patch) | |
tree | c3d38dc36cd4388c7b5afb42e860394dfdc0fcbd /sysutils/xdu | |
parent | c0f4375e8596c37575dc1cdbd2be9027f1e3d812 (diff) | |
download | pkgsrc-f49ce4666ac939cd901f7ad0f8f06bd437b9457b.tar.gz |
Deal with directory names with whitespace by using strtok_r instead of scanf.
Diffstat (limited to 'sysutils/xdu')
-rw-r--r-- | sysutils/xdu/files/patch-sum | 3 | ||||
-rw-r--r-- | sysutils/xdu/patches/patch-ab | 28 |
2 files changed, 30 insertions, 1 deletions
diff --git a/sysutils/xdu/files/patch-sum b/sysutils/xdu/files/patch-sum index 2616c386343..93a06bc54d3 100644 --- a/sysutils/xdu/files/patch-sum +++ b/sysutils/xdu/files/patch-sum @@ -1,3 +1,4 @@ -$NetBSD: patch-sum,v 1.1 2000/12/14 01:10:43 hubertf Exp $ +$NetBSD: patch-sum,v 1.2 2000/12/30 00:19:04 joda Exp $ MD5 (patch-aa) = 9d346838f1af4311d06aead14672cc40 +MD5 (patch-ab) = 745e4db2f7246fb6b2e0a95a7d5f527b diff --git a/sysutils/xdu/patches/patch-ab b/sysutils/xdu/patches/patch-ab new file mode 100644 index 00000000000..5d1180df889 --- /dev/null +++ b/sysutils/xdu/patches/patch-ab @@ -0,0 +1,28 @@ +$NetBSD: patch-ab,v 1.1 2000/12/30 00:19:06 joda Exp $ + +--- xdu.c.orig Sun Jun 5 21:29:23 1994 ++++ xdu.c Sat Dec 30 00:51:35 2000 +@@ -232,7 +232,6 @@ + char *filename; + { + char buf[4096]; +- char name[4096]; + int size; + FILE *fp; + +@@ -245,9 +244,12 @@ + } + } + while (fgets(buf,sizeof(buf),fp) != NULL) { +- sscanf(buf, "%d %s\n", &size, name); +- /*printf("%d %s\n", size, name);*/ +- parse_entry(name,size); ++ char *p, *q = NULL; ++ p = strtok_r(buf, " \t", &q); ++ size = atoi(p); ++ p = strtok_r(NULL, "\r\n", &q); ++ /* printf("%d %s\n", size, p); */ ++ parse_entry(p,size); + } + fclose(fp); + } |