artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ce198a4
)
Don't run off the end of path if it ends in /.
author
florian
<florian@openbsd.org>
Wed, 12 Jul 2023 15:45:34 +0000
(15:45 +0000)
committer
florian
<florian@openbsd.org>
Wed, 12 Jul 2023 15:45:34 +0000
(15:45 +0000)
OK op, sthen
usr.bin/patch/pch.c
patch
|
blob
|
history
diff --git
a/usr.bin/patch/pch.c
b/usr.bin/patch/pch.c
index
a3e0a9c
..
7c65062
100644
(file)
--- a/
usr.bin/patch/pch.c
+++ b/
usr.bin/patch/pch.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: pch.c,v 1.6
5 2023/07/12 15:44:47
florian Exp $ */
+/* $OpenBSD: pch.c,v 1.6
6 2023/07/12 15:45:34
florian Exp $ */
/*
* patch - a program to apply diffs to original files
@@
-1484,7
+1484,8
@@
num_components(const char *path)
size_t n;
const char *cp;
- for (n = 0, cp = path; (cp = strchr(cp, '/')) != NULL; n++, cp++) {
+ for (n = 0, cp = path; (cp = strchr(cp, '/')) != NULL; n++) {
+ cp++;
while (*cp == '/')
cp++; /* skip consecutive slashes */
}