mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-04-21 03:12:48 +02:00
(xfields): Used unsigned char* pointers to avoid
This commit is contained in:
@@ -195,7 +195,7 @@ static void
|
|||||||
xfields (struct line *line)
|
xfields (struct line *line)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
register char *ptr, *lim;
|
unsigned char *ptr, *lim;
|
||||||
|
|
||||||
ptr = line->beg;
|
ptr = line->beg;
|
||||||
lim = line->lim;
|
lim = line->lim;
|
||||||
@@ -211,7 +211,7 @@ xfields (struct line *line)
|
|||||||
{
|
{
|
||||||
if (tab)
|
if (tab)
|
||||||
{
|
{
|
||||||
char *beg;
|
unsigned char *beg;
|
||||||
|
|
||||||
beg = ptr;
|
beg = ptr;
|
||||||
while (ptr < lim && *ptr != tab)
|
while (ptr < lim && *ptr != tab)
|
||||||
@@ -222,7 +222,7 @@ xfields (struct line *line)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *beg;
|
unsigned char *beg;
|
||||||
|
|
||||||
beg = ptr;
|
beg = ptr;
|
||||||
while (ptr < lim && !ISSPACE (*ptr))
|
while (ptr < lim && !ISSPACE (*ptr))
|
||||||
@@ -233,7 +233,8 @@ xfields (struct line *line)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ptr > line->beg && ((tab && ISSPACE (ptr[-1])) || ptr[-1] == tab))
|
if ((char *) ptr > line->beg
|
||||||
|
&& ((tab && ISSPACE (ptr[-1])) || ptr[-1] == tab))
|
||||||
{
|
{
|
||||||
/* Add one more (empty) field because the last character of the
|
/* Add one more (empty) field because the last character of the
|
||||||
line was a delimiter. */
|
line was a delimiter. */
|
||||||
|
|||||||
Reference in New Issue
Block a user