Deleted Added
full compact
hexdump.c (216370) hexdump.c (229403)
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

--- 25 unchanged lines hidden (view full) ---

34#endif /* not lint */
35
36#ifndef lint
37#if 0
38static char sccsid[] = "@(#)hexdump.c 8.1 (Berkeley) 6/6/93";
39#endif
40#endif /* not lint */
41#include <sys/cdefs.h>
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

--- 25 unchanged lines hidden (view full) ---

34#endif /* not lint */
35
36#ifndef lint
37#if 0
38static char sccsid[] = "@(#)hexdump.c 8.1 (Berkeley) 6/6/93";
39#endif
40#endif /* not lint */
41#include <sys/cdefs.h>
42__FBSDID("$FreeBSD: head/usr.bin/hexdump/hexdump.c 216370 2010-12-11 08:32:16Z joel $");
42__FBSDID("$FreeBSD: head/usr.bin/hexdump/hexdump.c 229403 2012-01-03 18:51:58Z ed $");
43
44#include <sys/types.h>
45#include <locale.h>
46#include <stdlib.h>
47#include <stdio.h>
48#include <string.h>
49#include "hexdump.h"
50

--- 5 unchanged lines hidden (view full) ---

56int
57main(int argc, char *argv[])
58{
59 FS *tfs;
60 char *p;
61
62 (void)setlocale(LC_ALL, "");
63
43
44#include <sys/types.h>
45#include <locale.h>
46#include <stdlib.h>
47#include <stdio.h>
48#include <string.h>
49#include "hexdump.h"
50

--- 5 unchanged lines hidden (view full) ---

56int
57main(int argc, char *argv[])
58{
59 FS *tfs;
60 char *p;
61
62 (void)setlocale(LC_ALL, "");
63
64 if (!(p = rindex(argv[0], 'o')) || strcmp(p, "od"))
64 if (!(p = strrchr(argv[0], 'o')) || strcmp(p, "od"))
65 newsyntax(argc, &argv);
66 else
67 oldsyntax(argc, &argv);
68
69 /* figure out the data block size */
70 for (blocksize = 0, tfs = fshead; tfs; tfs = tfs->nextfs) {
71 tfs->bcnt = size(tfs);
72 if (blocksize < tfs->bcnt)
73 blocksize = tfs->bcnt;
74 }
75 /* rewrite the rules, do syntax checking */
76 for (tfs = fshead; tfs; tfs = tfs->nextfs)
77 rewrite(tfs);
78
79 (void)next(argv);
80 display();
81 exit(exitval);
82}
65 newsyntax(argc, &argv);
66 else
67 oldsyntax(argc, &argv);
68
69 /* figure out the data block size */
70 for (blocksize = 0, tfs = fshead; tfs; tfs = tfs->nextfs) {
71 tfs->bcnt = size(tfs);
72 if (blocksize < tfs->bcnt)
73 blocksize = tfs->bcnt;
74 }
75 /* rewrite the rules, do syntax checking */
76 for (tfs = fshead; tfs; tfs = tfs->nextfs)
77 rewrite(tfs);
78
79 (void)next(argv);
80 display();
81 exit(exitval);
82}