1 |
commit: a68b9b4ebc840805f504fe681196e7f15737985d |
2 |
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon May 25 11:03:36 2020 +0000 |
4 |
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 25 11:03:36 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=a68b9b4e |
7 |
|
8 |
libq/atom: fixup USE-dep printing in atom_format |
9 |
|
10 |
Bug: https://bugs.gentoo.org/724892 |
11 |
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org> |
12 |
|
13 |
libq/atom.c | 20 ++++++++++++++------ |
14 |
1 file changed, 14 insertions(+), 6 deletions(-) |
15 |
|
16 |
diff --git a/libq/atom.c b/libq/atom.c |
17 |
index 7e72bf3..acf28be 100644 |
18 |
--- a/libq/atom.c |
19 |
+++ b/libq/atom.c |
20 |
@@ -939,12 +939,20 @@ atom_format_r( |
21 |
} else if (!strncmp("USE", fmt, len)) { |
22 |
if (showit || atom->usedeps) { |
23 |
atom_usedep *ud; |
24 |
- append_buf(buf, buflen, "%s", "["); |
25 |
- for (ud = atom->usedeps; ud != NULL; ud = ud->next) |
26 |
- append_buf(buf, buflen, "%s%s%s%s%s%s", |
27 |
- MAGENTA, atom_usecond_str[ud->pfx_cond], |
28 |
- ud->use, atom_usecond_str[ud->sfx_cond], |
29 |
- NORM, ud->next == NULL ? "]" : ","); |
30 |
+ if (atom->usedeps == NULL) { |
31 |
+ append_buf(buf, buflen, "%s", "<unset>"); |
32 |
+ } else { |
33 |
+ if (connected) |
34 |
+ append_buf(buf, buflen, "%s", "["); |
35 |
+ for (ud = atom->usedeps; ud != NULL; ud = ud->next) |
36 |
+ append_buf(buf, buflen, "%s%s%s%s%s%s", |
37 |
+ MAGENTA, atom_usecond_str[ud->pfx_cond], |
38 |
+ ud->use, atom_usecond_str[ud->sfx_cond], |
39 |
+ NORM, ud->next == NULL ? "" : |
40 |
+ (connected ? "," : " ")); |
41 |
+ if (connected) |
42 |
+ append_buf(buf, buflen, "%s", "]"); |
43 |
+ } |
44 |
} |
45 |
} else |
46 |
append_buf(buf, buflen, "<BAD:%.*s>", (int)len, fmt); |