parse.c (96795) | parse.c (97329) |
---|---|
1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/6/93"; 37#endif 38static const char rcsid[] = | 1/* 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 22 unchanged lines hidden (view full) --- 31 * SUCH DAMAGE. 32 */ 33 34#ifndef lint 35#if 0 36static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/6/93"; 37#endif 38static const char rcsid[] = |
39 "$FreeBSD: head/usr.bin/hexdump/parse.c 96795 2002-05-17 07:14:55Z tjr $"; | 39 "$FreeBSD: head/usr.bin/hexdump/parse.c 97329 2002-05-27 03:17:28Z tjr $"; |
40#endif /* not lint */ 41 42#include <sys/types.h> 43 44#include <err.h> 45#include <fcntl.h> 46#include <stdio.h> 47#include <stdlib.h> --- 371 unchanged lines hidden (view full) --- 419 * If the format string interprets any data at all, and it's 420 * not the same as the blocksize, and its last format unit 421 * interprets any data at all, and has no iteration count, 422 * repeat it as necessary. 423 * 424 * If, rep count is greater than 1, no trailing whitespace 425 * gets output from the last iteration of the format unit. 426 */ | 40#endif /* not lint */ 41 42#include <sys/types.h> 43 44#include <err.h> 45#include <fcntl.h> 46#include <stdio.h> 47#include <stdlib.h> --- 371 unchanged lines hidden (view full) --- 419 * If the format string interprets any data at all, and it's 420 * not the same as the blocksize, and its last format unit 421 * interprets any data at all, and has no iteration count, 422 * repeat it as necessary. 423 * 424 * If, rep count is greater than 1, no trailing whitespace 425 * gets output from the last iteration of the format unit. 426 */ |
427 for (fu = fs->nextfu;; fu = fu->nextfu) { | 427 for (fu = fs->nextfu; fu; fu = fu->nextfu) { |
428 if (!fu->nextfu && fs->bcnt < blocksize && 429 !(fu->flags&F_SETREP) && fu->bcnt) 430 fu->reps += (blocksize - fs->bcnt) / fu->bcnt; 431 if (fu->reps > 1) { 432 for (pr = fu->nextpr;; pr = pr->nextpr) 433 if (!pr->nextpr) 434 break; 435 for (p1 = pr->fmt, p2 = NULL; *p1; ++p1) 436 p2 = isspace(*p1) ? p1 : NULL; 437 if (p2) 438 pr->nospace = p2; 439 } | 428 if (!fu->nextfu && fs->bcnt < blocksize && 429 !(fu->flags&F_SETREP) && fu->bcnt) 430 fu->reps += (blocksize - fs->bcnt) / fu->bcnt; 431 if (fu->reps > 1) { 432 for (pr = fu->nextpr;; pr = pr->nextpr) 433 if (!pr->nextpr) 434 break; 435 for (p1 = pr->fmt, p2 = NULL; *p1; ++p1) 436 p2 = isspace(*p1) ? p1 : NULL; 437 if (p2) 438 pr->nospace = p2; 439 } |
440 if (!fu->nextfu) 441 break; | |
442 } 443#ifdef DEBUG 444 for (fu = fs->nextfu; fu; fu = fu->nextfu) { 445 (void)printf("fmt:"); 446 for (pr = fu->nextpr; pr; pr = pr->nextpr) 447 (void)printf(" {%s}", pr->fmt); 448 (void)printf("\n"); 449 } --- 72 unchanged lines hidden --- | 440 } 441#ifdef DEBUG 442 for (fu = fs->nextfu; fu; fu = fu->nextfu) { 443 (void)printf("fmt:"); 444 for (pr = fu->nextpr; pr; pr = pr->nextpr) 445 (void)printf(" {%s}", pr->fmt); 446 (void)printf("\n"); 447 } --- 72 unchanged lines hidden --- |