diff options
author | Fabian Groffen <grobian@gentoo.org> | 2019-06-05 11:14:19 +0200 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2019-06-05 11:14:19 +0200 |
commit | 85c445dbc0d3526ff2df263f1d48dbc67433cd10 (patch) | |
tree | 767cafae6dabfb56f47a4bfb79ef867e4285f016 | |
parent | libq/hash: fix compilation without HAVE_SSL and HAVE_BLAKE2B (diff) | |
download | portage-utils-85c445db.tar.gz portage-utils-85c445db.tar.bz2 portage-utils-85c445db.zip |
libq/atom: retain all input in atom_format_r
Copy the remainder, as well as data before and inbetween expandos.
Bug: https://bugs.gentoo.org/687416
Signed-off-by: Fabian Groffen <grobian@gentoo.org>
-rw-r--r-- | libq/atom.c | 3 | ||||
-rw-r--r-- | qatom.c | 5 |
2 files changed, 4 insertions, 4 deletions
diff --git a/libq/atom.c b/libq/atom.c index 5627415d..ae781a8a 100644 --- a/libq/atom.c +++ b/libq/atom.c @@ -645,8 +645,7 @@ atom_format_r( while (*p != '\0') { fmt = strchr(p, '%'); if (fmt == NULL) { - if (buflen > 0) - *buf = '\0'; + append_buf(buf, buflen, "%s", p); return buf; } else if (fmt != p) { append_buf(buf, buflen, "%.*s", (int)(fmt - p), p); @@ -4,6 +4,7 @@ * * Copyright 2005-2008 Ned Ludd - <solar@gentoo.org> * Copyright 2005-2014 Mike Frysinger - <vapier@gentoo.org> + * Copyright 2018- Fabian Groffen - <grobian@gentoo.org> */ #include "main.h" @@ -41,9 +42,9 @@ int qatom_main(int argc, char **argv) while ((i = GETOPT_LONG(QATOM, qatom, "")) != -1) { switch (i) { - case 'F': format = optarg; break; + case 'F': format = optarg; break; case 'c': action = _COMPARE; break; - case 'p': action = _PRINT; break; + case 'p': action = _PRINT; break; COMMON_GETOPTS_CASES(qatom) } } |