projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c8d3838
)
sort: fix --debug display with very large offsets
author
Paul Eggert
<eggert@cs.ucla.edu>
Tue, 27 Jul 2010 18:01:10 +0000
(11:01 -0700)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Tue, 27 Jul 2010 18:01:48 +0000
(11:01 -0700)
* src/sort.c (mark_key): Don't assume offset <= INT_MAX.
Make the code a bit clearer when width != 0.
src/sort.c
patch
|
blob
|
history
diff --git
a/src/sort.c
b/src/sort.c
index
588bae8
..
f552d21
100644
(file)
--- a/
src/sort.c
+++ b/
src/sort.c
@@
-2162,14
+2162,17
@@
count_tabs (char const *text, size_t len)
static void
mark_key (size_t offset, size_t width)
{
- printf ("%*s", (int) offset, "");
+ while (offset--)
+ putchar (' ');
if (!width)
printf (_("^ no match for key\n"));
else
{
- while (width--)
+ do
putchar ('_');
+ while (--width);
+
putchar ('\n');
}
}