Description: 1.03-14 changes, as part of conversion to 3.0/quilt
 Original maintainer added a makefile, and various quoting changes in
 the man pages and the code itself needed various C-89 modernization
 (see debian/changelog 1.03-1.)
Author: Mark W. Eichin <eichin@thok.org>

--- /dev/null
+++ lx-gdb-1.03/Makefile
@@ -0,0 +1,34 @@
+#
+# makefile for gdbdump/gdbload
+#   C source by Steve Roth <stever@cup.hp.com>/Arne Christensen <arc@pine.dk>
+#   Makefile by Darren Stalder <torin@daft.com>
+
+VERSION = 1.03
+
+prefix = /usr/local
+BINDIR = $(prefix)/bin
+MANDIR = $(prefix)/share/man/man1
+
+PROGRAMS = gdbload gdbdump
+MANPAGES = gdbload.1 gdbdump.1
+SOURCES = gdbload.c gdbdump.c
+CFLAGS = -Wall -O2 -Wstrict-prototypes
+
+all binary: $(PROGRAMS)
+
+# the following assumes a GNU install.  If you don't have one use install-cp
+
+install: $(PROGRAMS)
+	install -m 755 $(PROGRAMS) $(BINDIR)
+	install -m 644 $(MANPAGES) $(MANDIR)
+
+install-cp: $(PROGRAMS)
+	cp $(PROGRAMS) $(BINDIR)
+	(cd $(BINDIR); chmod 755 $(PROGRAMS))
+	cp $(MANPAGES) $(MANDIR)
+	(cd $(MANDIR); chmod 644 $(MANPAGES))
+
+clean:
+	-rm -f $(PROGRAMS)
+
+.PHONY: all binary install install-cp clean
--- lx-gdb-1.03.orig/gdbload.1
+++ lx-gdb-1.03/gdbload.1
@@ -56,18 +56,19 @@ Text fields, category fields, number fie
 have their text quoted if it contains commas or newlines.
 The following escape sequences are understood:
 .RS
-. Can't produce a \ on Solaris nroff, need to manually substitute \ for % !
+.\" Can't produce a \ on Solaris nroff, need to manually substitute \ for % !
+.\" We can produce a \ using groff though...
 .TP
-.B "%r"
+.B "\er"
 Carriage return (ASCII 13).
 .TP
-.B "%n"
+.B "\en"
 Line feed (ASCII 10).
 .TP
-.B "%nnn"
+.B "\ennn"
 nnn are octal digits representing a character.
 .TP
-.B "%xnn"
+.B "\exnn"
 nn are hexadecimal digits representing a character.
 .RE
 .PP
--- lx-gdb-1.03.orig/gdbload.c
+++ lx-gdb-1.03/gdbload.c
@@ -71,11 +71,14 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 /* This define is needed for HP-UX systems, and probably not anywhere else
  * I would guess.  Comment it in if needed.
  */
-/*#define stricmp   strcasecmp*/
+#if defined(__hpux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)
+#define stricmp   strcasecmp
+#endif
 
 #define MAXFIELDS 100			/* Max. fields in a database */
 
@@ -110,14 +113,14 @@ FILE  * hfOld;				/* Old database handle
 FILE  * hfIn;				/* Input stream handle */
 
 /* This routine exits the program with an error message. */
-die(char * message)
+int die(char * message)
 	{
 	fprintf(stderr, "gdbload(%d): %s\n", lineNum, message);
 	exit(1);
 	}
 
 /* This routine exits the program with a usage message. */
-usage()
+int usage(void)
 	{
 	fprintf(stderr,
 	        "usage: gdbload [-an] <database file> [<input file>]\n");
@@ -157,7 +160,7 @@ void parseArgs(int    argc,
 	}
 
 /* Generate the file names we need. */
-void makeFileNames()
+void makeFileNames(void)
 	{
 	char * pch;
 
@@ -448,7 +451,7 @@ RecordHandler RecordHandlers[32] =
 /* This routine copies the appropriate records of the old database to the
  * new.
  */
-void copyDatabase()
+void copyDatabase(void)
 	{
 	uchar rechdr[6];		/* Record header buffer */
 	int   reclen;			/* Record length */
@@ -509,7 +512,7 @@ void copyDatabase()
 	}
 
 /* This routine reads a line of input and breaks it into fields. */
-void readLine()
+void readLine(void)
 	{
 	int     field = 0;		/* Field number being read */
 	int     matchQuote = FALSE;	/* Inside quotation marks */
@@ -655,9 +658,9 @@ int matchField(uchar * name1,
 	namebuf1[20] = namebuf2[20] = '\0';
 
 	/* Remove &s from the field names */
-	while (pch = strchr(namebuf1, '&'))
+	while ((pch = strchr(namebuf1, '&')) != NULL)
 		memmove(pch, pch+1, strlen(pch));
-	while (pch = strchr(namebuf2, '&'))
+	while ((pch = strchr(namebuf2, '&')) != NULL)
 		memmove(pch, pch+1, strlen(pch));
 
 	/* Return a case-insensitive comparison of the result. */
@@ -667,7 +670,7 @@ int matchField(uchar * name1,
 /* This routine reads the line of field names and compares it with the
  * field definitions in the database.
  */
-void readFields()
+void readFields(void)
 	{
 	int i;
 
@@ -919,11 +922,11 @@ void DoField(uchar * line,
 	}
 
 /* This routine adds the input records to the database. */
-void addRecords()
+void addRecords(void)
 	{
 	uchar rechdr[6];		/* Record header buffer */
 	int   endrec;			/* Offset of first unused by in rec */
-	int   note;			/* Record # of associated note */
+	int   note = 0;			/* Record # of associated note */
 	int   i;
 
 	do
@@ -975,7 +978,7 @@ void addRecords()
 /* This routine writes out the database header, the categories record,
  * and the index table.
  */
-void writeHeader()
+void writeHeader(void)
 	{
 	uchar rechdr[6];		/* Record header buffer */
 	int   reclen;			/* Record length */
@@ -1013,8 +1016,8 @@ void writeHeader()
 	}
 
 /* Main program. */
-main(int    argc,
-     char * argv[])
+int main(int    argc,
+		 char * argv[])
 	{
 	parseArgs(argc, argv);
 	makeFileNames();
