comparison src/xxd/xxd.c @ 25980:0ff315dd0c48 v8.2.3523

patch 8.2.3523: duplicated code in xxd Commit: https://github.com/vim/vim/commit/c89c91cafd91fbf17f431d800bbf4cafcffffe7a Author: DungSaga <dungsaga@users.noreply.github.com> Date: Sat Oct 16 19:07:46 2021 +0100 patch 8.2.3523: duplicated code in xxd Problem: Duplicated code in xxd. Solution: Remove duplicated lines. (closes https://github.com/vim/vim/issues/8972)
author Bram Moolenaar <Bram@vim.org>
date Sat, 16 Oct 2021 20:15:03 +0200
parents 5690cf66ee07
children 2294ed638906
comparison
equal deleted inserted replaced
25979:05065e623c89 25980:0ff315dd0c48
344 have_off++; 344 have_off++;
345 want_off++; 345 want_off++;
346 n1 = -1; 346 n1 = -1;
347 if ((++p >= cols) && !hextype) 347 if ((++p >= cols) && !hextype)
348 { 348 {
349 /* skip rest of line as garbage */ 349 /* skip the rest of the line as garbage */
350 want_off = 0; 350 n2 = -1;
351 while ((c = getc(fpi)) != '\n' && c != EOF) 351 n3 = -1;
352 ; 352 }
353 if (c == EOF && ferror(fpi)) 353 }
354 die(2); 354 if (n1 < 0 && n2 < 0 && n3 < 0)
355 ign_garb = 1;
356 }
357 }
358 else if (n1 < 0 && n2 < 0 && n3 < 0)
359 { 355 {
360 /* already stumbled into garbage, skip line, wait and see */ 356 /* already stumbled into garbage, skip line, wait and see */
361 if (!hextype) 357 if (!hextype)
362 want_off = 0; 358 want_off = 0;
363 while ((c = getc(fpi)) != '\n' && c != EOF) 359 while ((c = getc(fpi)) != '\n' && c != EOF)