diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1999-01-05 11:26:35 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1999-01-05 11:26:35 +0000 |
commit | f8b9a3ac7dc51643780fcf402e1bd117377aa11b (patch) | |
tree | fea69c0e819e0368f63d394306760fef7f294860 /hdrline.c | |
parent | 4d6b5611ef0211369f3011e357d65573cf5ea73b (diff) |
[unstable] merging changes from stable.
Diffstat (limited to 'hdrline.c')
-rw-r--r-- | hdrline.c | 24 |
1 files changed, 20 insertions, 4 deletions
@@ -414,8 +414,16 @@ hdr_format_str (char *dest, break; case 'l': - snprintf (fmt, sizeof (fmt), "%%%sd", prefix); - snprintf (dest, destlen, fmt, (int) hdr->lines); + if (!optional) + { + snprintf (fmt, sizeof (fmt), "%%%sd", prefix); + snprintf (dest, destlen, fmt, (int) hdr->lines); + } + else + { + if (hdr->lines > 0) + optional = 0; + } break; case 'L': @@ -448,8 +456,16 @@ hdr_format_str (char *dest, break; case 'N': - snprintf (fmt, sizeof (fmt), "%%%sd", prefix); - snprintf (dest, destlen, fmt, hdr->score); + if (!optional) + { + snprintf (fmt, sizeof (fmt), "%%%sd", prefix); + snprintf (dest, destlen, fmt, hdr->score); + } + else + { + if (hdr->score > 0) + optional = 0; + } break; case 'O': |