1 |
commit: e39cbfcefe03f6160894201df6174cec4b4e7946 |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jun 5 13:09:51 2019 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jun 5 13:09:51 2019 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=e39cbfce |
7 |
|
8 |
libq/atom: really fix retaining input in atom_format_r |
9 |
|
10 |
return the start of the buffer, not the end (= empty) |
11 |
add tests this time that show the bug is now fixed |
12 |
|
13 |
Bug: https://bugs.gentoo.org/687416 |
14 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
15 |
|
16 |
libq/atom.c | 2 +- |
17 |
tests/qatom/dotest | 2 ++ |
18 |
2 files changed, 3 insertions(+), 1 deletion(-) |
19 |
|
20 |
diff --git a/libq/atom.c b/libq/atom.c |
21 |
index ae781a8..8b1b47a 100644 |
22 |
--- a/libq/atom.c |
23 |
+++ b/libq/atom.c |
24 |
@@ -646,7 +646,7 @@ atom_format_r( |
25 |
fmt = strchr(p, '%'); |
26 |
if (fmt == NULL) { |
27 |
append_buf(buf, buflen, "%s", p); |
28 |
- return buf; |
29 |
+ return ret; |
30 |
} else if (fmt != p) { |
31 |
append_buf(buf, buflen, "%.*s", (int)(fmt - p), p); |
32 |
} |
33 |
|
34 |
diff --git a/tests/qatom/dotest b/tests/qatom/dotest |
35 |
index 24bd67b..c173de3 100755 |
36 |
--- a/tests/qatom/dotest |
37 |
+++ b/tests/qatom/dotest |
38 |
@@ -56,6 +56,8 @@ test f16 "media-fonts font-adobe-100dpi 1.0.3 r1" \ |
39 |
test f17 "games-rpg eschalon-book-1-demo 106 r1" \ |
40 |
-F '%{CATEGORY} %{PN} %{PV} %{PR}' \ |
41 |
"games-rpg/eschalon-book-1-demo-106-r1" |
42 |
+test f18 "bla" -F 'bla' "cat/pkg-c" # bug #687416 |
43 |
+test f19 ":pkg-c-1.4" -F ':%{PN}-1.4' "cat/pkg-c" # bug #687416 |
44 |
|
45 |
# Comparison tests |
46 |
test c01 "cat/pkg-123-r3 == pkg" \ |