From: Eric S. Raymond Date: Tue, 14 Sep 1999 02:17:14 +0000 (+0000) Subject: Version 1.2 X-Git-Tag: 1.2 X-Git-Url: http://thyrsus.com/gitweb/?a=commitdiff_plain;h=3f8f4fca00826c282c034a494b50d76525f9cd7d;p=hexdump.git Version 1.2 --- diff --git a/Makefile b/Makefile index 816c629..9b5c4ad 100644 --- a/Makefile +++ b/Makefile @@ -1,29 +1,30 @@ # Makefile for Eric Raymond's silly hex dumper -# Note: When the version changes, you also have to change -# * the name of the containing directory -# * the RPM spec file -VERS=1.1 +# Note: When the version changes, you also have to change the RPM spec file +VERS=1.2 hex: hex.c + $(CC) -DVERSION=\"$(VERS)\" -O hex.c -o hex SOURCES = READ.ME Makefile hex.c hex.1 hex.lsm hex.spec -hex-$(VERS).tar: $(SOURCES) - tar --name-prefix "hex-$(VERS)/" -cvf hex-$(VERS).tar $(SOURCES) -hex-$(VERS).tar.gz: hex-$(VERS).tar - gzip -f hex-$(VERS).tar - -hex.shar: $(SOURCES) - shar $(SOURCES) >hex.shar +hex-$(VERS).tar.gz: + @ls $(SRC) | sed s:^:hex-$(VERS)/: >MANIFEST + @(cd ..; ln -s hex hex-$(VERS)) + (cd ..; tar -czvf hex/hex-$(VERS).tar.gz `cat hex/MANIFEST`) + @(cd ..; rm hex-$(VERS)) clean: - rm -f hex hex.tar hex.shar + rm -f hex hex-$(VERS).tar.gz *.rpm + +dist: hex-$(VERS).tar.gz RPMROOT=/usr/src/redhat RPM = rpm RPMFLAGS = -ba -rpm: hex-$(VERS).tar.gz - cp hex-$(VERS).tar.gz $(RPMROOT)/SOURCES/hex-$(VERS).tar.gz - cp hex.spec $(RPMROOT)/SPECS/hex.spec - $(RPM) $(RPMFLAGS) hex.spec +rpm: dist + cp hex-$(VERS).tar.gz $(RPMROOT)/SOURCES; + cp hex.spec $(RPMROOT)/SPECS + cd $(RPMROOT)/SPECS; $(RPM) $(RPMFLAGS) hex.spec + cp $(RPMROOT)/RPMS/`arch|sed 's/i[4-9]86/i386/'`/hex-$(VERS)*.rpm . + cp $(RPMROOT)/SRPMS/hex-$(VERS)*.src.rpm . diff --git a/README b/README index 217e5ef..57e1f92 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ - HEX 1.1 + HEX 1.2 (by Eric S. Raymond ) This hex dumper was born because diff --git a/hexdump.c b/hexdump.c index ac01b83..784ae73 100644 --- a/hexdump.c +++ b/hexdump.c @@ -1,4 +1,29 @@ -/* hex.c -- generate CP/M style hex dumps */ +/***************************************************************************** + +hex.c -- generate CP/M style hex dumps + +Copyright (c) 1999 by Eric S. Raymond

+ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions:

+ +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software.

+ +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE.

+ +*****************************************************************************/ + #include #include @@ -151,7 +176,7 @@ char *cp; base = 10; break; } - else if (*cp = 'x' || *cp == 'X' || *cp == 'h' || *cp == 'H') + else if (*cp == 'x' || *cp == 'X' || *cp == 'h' || *cp == 'H') { base = 16; cp++; @@ -206,6 +231,10 @@ char *argv[]; switch (c) { + case 'V': + printf("hex " VERSION " by Eric S. Raymond.\n"); + exit(0); + case 'e': eflag = (s == '-'); continue; case 'c': cflag = (s == '-'); continue; case 'g': gflag = (s == '-'); continue; diff --git a/hexdump.spec b/hexdump.spec index 7d84d5a..2950792 100644 --- a/hexdump.spec +++ b/hexdump.spec @@ -1,8 +1,8 @@ Name: hex -Version: 1.1 +Version: 1.2 Release: 1 Summary: yet another hex dumper -Source: locke.ccil.org:/pub/esr/hex-1.1.tar.gz +Source: locke.ccil.org:/pub/esr/hex-1.2.tar.gz Copyright: BSD-like Group: Development/Tools diff --git a/hexdump.xml b/hexdump.xml index a764054..9485c10 100644 --- a/hexdump.xml +++ b/hexdump.xml @@ -2,7 +2,7 @@ .SH NAME hex.c \- dump a file to stdout in CP/M-like hex format .SH SYNOPSIS -.B hex [-w] [-e] [-c] [-g] [-s] [filename...] +.B hex [-V] [-w] [-e] [-c] [-g] [-s] [filename...] .SH DESCRIPTION This program provides a facility for obtaining a dump of a binary file to stdout. The default format is a CP/M style hex dump with byte @@ -21,6 +21,8 @@ The program accepts the following options to control its output: -g -- don't output mid-page gutter .TP 10 -s -- dump file section +.TP 10 +-V -- print version number and exit .PP The command line is scanned left-to-right for filenames and options, and each file dumped according to the format defined by preceding options. To