hexsyntax.c (216370) | hexsyntax.c (229403) |
---|---|
1/*- 2 * Copyright (c) 1990, 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 --- 19 unchanged lines hidden (view full) --- 28 */ 29 30#ifndef lint 31#if 0 32static char sccsid[] = "@(#)hexsyntax.c 8.2 (Berkeley) 5/4/95"; 33#endif 34#endif /* not lint */ 35#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1990, 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 --- 19 unchanged lines hidden (view full) --- 28 */ 29 30#ifndef lint 31#if 0 32static char sccsid[] = "@(#)hexsyntax.c 8.2 (Berkeley) 5/4/95"; 33#endif 34#endif /* not lint */ 35#include <sys/cdefs.h> |
36__FBSDID("$FreeBSD: head/usr.bin/hexdump/hexsyntax.c 216370 2010-12-11 08:32:16Z joel $"); | 36__FBSDID("$FreeBSD: head/usr.bin/hexdump/hexsyntax.c 229403 2012-01-03 18:51:58Z ed $"); |
37 38#include <sys/types.h> 39 40#include <err.h> 41#include <stdio.h> 42#include <stdlib.h> 43#include <string.h> 44#include <unistd.h> --- 4 unchanged lines hidden (view full) --- 49 50void 51newsyntax(int argc, char ***argvp) 52{ 53 int ch; 54 char *p, **argv; 55 56 argv = *argvp; | 37 38#include <sys/types.h> 39 40#include <err.h> 41#include <stdio.h> 42#include <stdlib.h> 43#include <string.h> 44#include <unistd.h> --- 4 unchanged lines hidden (view full) --- 49 50void 51newsyntax(int argc, char ***argvp) 52{ 53 int ch; 54 char *p, **argv; 55 56 argv = *argvp; |
57 if ((p = rindex(argv[0], 'h')) != NULL && | 57 if ((p = strrchr(argv[0], 'h')) != NULL && |
58 strcmp(p, "hd") == 0) { 59 /* "Canonical" format, implies -C. */ 60 add("\"%08.8_Ax\n\""); 61 add("\"%08.8_ax \" 8/1 \"%02x \" \" \" 8/1 \"%02x \" "); 62 add("\" |\" 16/1 \"%_p\" \"|\\n\""); 63 } 64 while ((ch = getopt(argc, argv, "bcCde:f:n:os:vx")) != -1) 65 switch (ch) { --- 75 unchanged lines hidden --- | 58 strcmp(p, "hd") == 0) { 59 /* "Canonical" format, implies -C. */ 60 add("\"%08.8_Ax\n\""); 61 add("\"%08.8_ax \" 8/1 \"%02x \" \" \" 8/1 \"%02x \" "); 62 add("\" |\" 16/1 \"%_p\" \"|\\n\""); 63 } 64 while ((ch = getopt(argc, argv, "bcCde:f:n:os:vx")) != -1) 65 switch (ch) { --- 75 unchanged lines hidden --- |