]> granicus.if.org Git - vim/commitdiff
patch 8.2.3523: duplicated code in xxd v8.2.3523
authorDungSaga <dungsaga@users.noreply.github.com>
Sat, 16 Oct 2021 18:07:46 +0000 (19:07 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 16 Oct 2021 18:07:46 +0000 (19:07 +0100)
Problem:    Duplicated code in xxd.
Solution:   Remove duplicated lines. (closes #8972)

src/version.c
src/xxd/xxd.c

index 1b6e997bfa795645349665e4daa1415e95c7bffe..8048f8e995dad3806df4547f20010451ce9adfe2 100644 (file)
@@ -757,6 +757,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3523,
 /**/
     3522,
 /**/
index 94cc220bfbbb9cfdf850f917a280fec56118d386..698971a8642b7b188fe81acd49fe3db42c02d6f8 100644 (file)
@@ -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)