diff options
author | DungSaga <dungsaga@users.noreply.github.com> | 2021-10-16 19:07:46 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-10-16 19:07:46 +0100 |
commit | c89c91cafd91fbf17f431d800bbf4cafcffffe7a (patch) | |
tree | 2358b92683f980ee7a5c77b58e22485c7abf1eeb | |
parent | 93ff6720fe4427341bc426b6d46e6324f226c270 (diff) | |
download | vim-git-c89c91cafd91fbf17f431d800bbf4cafcffffe7a.tar.gz |
patch 8.2.3523: duplicated code in xxdv8.2.3523
Problem: Duplicated code in xxd.
Solution: Remove duplicated lines. (closes #8972)
-rw-r--r-- | src/version.c | 2 | ||||
-rw-r--r-- | src/xxd/xxd.c | 12 |
2 files changed, 6 insertions, 8 deletions
diff --git a/src/version.c b/src/version.c index 1b6e997bf..8048f8e99 100644 --- a/src/version.c +++ b/src/version.c @@ -758,6 +758,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3523, +/**/ 3522, /**/ 3521, diff --git a/src/xxd/xxd.c b/src/xxd/xxd.c index 94cc220bf..698971a86 100644 --- a/src/xxd/xxd.c +++ b/src/xxd/xxd.c @@ -346,16 +346,12 @@ huntype( n1 = -1; if ((++p >= cols) && !hextype) { - /* skip rest of line as garbage */ - want_off = 0; - while ((c = getc(fpi)) != '\n' && c != EOF) - ; - if (c == EOF && ferror(fpi)) - die(2); - ign_garb = 1; + /* skip the rest of the line as garbage */ + n2 = -1; + n3 = -1; } } - else if (n1 < 0 && n2 < 0 && n3 < 0) + if (n1 < 0 && n2 < 0 && n3 < 0) { /* already stumbled into garbage, skip line, wait and see */ if (!hextype) |