2004-09-25  Juan Manuel Guerrero  <st001906@hrz1.hrz.tu-darmstadt.de>

	* Makefile: Added SHELL, prefix, mandir and EXEEXT variables
	to make the installation process more flexible.
	* convert.c (print_with_special_exprs): Pacify gcc.
	(word_print_core): Pacify gcc.
	* error.c [__DJGPP__]: included stdlib.h for exit() definition.
	* main.c [__DJGPP__]: included stdlib.h for exit() definition.
	* output.c [__DJGPP__]: included stdlib.h for exit() definition.



diff -apruNU3 unrtf-0.19.3.orig/Makefile unrtf-0.19.3/Makefile
--- unrtf-0.19.3.orig/Makefile	2004-02-18 23:35:02.000000000 +0000
+++ unrtf-0.19.3/Makefile	2004-09-25 04:10:10.000000000 +0000
@@ -24,40 +24,49 @@
 # Makefile for UnRTF
 #
 
+SHELL = /bin/sh
 
-CFLAGS=-g -Wall
+prefix=/dev/env/DJDIR
+mandir=${prefix}/man/man1
+
+EXEEXT=.exe
+
+CFLAGS=-g -Wall -O2
 CC=gcc
 
 OBJS=convert.o word.o error.o main.o hash.o \
 	parse.o malloc.o attr.o util.o \
 	output.o html.o text.o vt.o ps.o latex.o wpml.o entity.o
 
-TARGET=unrtf
+TARGET=unrtf${EXEEXT}
 
 ${TARGET}:	${OBJS}
 	gcc ${OBJS} -o ${TARGET}
 
 clean:
-	rm -f ${OBJS} ${TARGET} bcount bcount.o
+	rm -f ${OBJS} ${TARGET} bcount${EXEEXT} bcount.o
 
 tidy:
 	rm -f ${OBJS} bcount.o
 	strip ${TARGET}
 
 tests:
-	${TARGET} test/table.rtf > test/table.html
-	${TARGET} test/slashnewline.rtf > test/slashnewline.html
-	${TARGET} test/fontface.rtf > test/fontface.html
-	${TARGET} test/fontsize.rtf > test/fontsize.html
+	./${TARGET} test/table.rtf > test/table.html
+	./${TARGET} test/slashnewline.rtf > test/slashnewline.html
+	./${TARGET} test/fontface.rtf > test/fontface.html
+	./${TARGET} test/fontsize.rtf > test/fontsize.html
 
-bcount:	bcount.c
-	gcc bcount.c -o bcount
+bcount${EXEEXT}:	bcount.c
+	gcc bcount.c -o bcount${EXEEXT}
 
-all:	${TARGET} bcount
+all:	${TARGET} bcount${EXEEXT}
 	rm -f ${OBJS}
 
 install:	${TARGET}
-	cp ${TARGET} /usr/local/bin
+	-mkdir -p ${prefix}/bin
+	-mkdir -p ${mandir}
+	cp ${TARGET} ${prefix}/bin
+	cp unrtf.1 ${mandir}
 
 attr.o: attr.c defs.h error.h attr.h main.h malloc.h
 convert.o: convert.c attr.h convert.h defs.h error.h hash.h main.h malloc.h \
diff -apruNU3 unrtf-0.19.3.orig/convert.c unrtf-0.19.3/convert.c
--- unrtf-0.19.3.orig/convert.c	2004-02-18 23:35:02.000000000 +0000
+++ unrtf-0.19.3/convert.c	2004-09-25 04:08:28.000000000 +0000
@@ -2369,6 +2369,7 @@ enum { SMALL=0, BIG=1 };
 
 	CHECK_PARAM_NOT_NULL(s);
 
+	state=SMALL;
 	if (simulate_smallcaps) {
 		if (*s >= 'a' && *s <= 'z') {
 			state=SMALL;
@@ -2743,7 +2744,7 @@ word_print_core (Word *w)
 					int have_param=FALSE, param=0;
 					HashItem *hip;
 					char *p;
-					int match;
+					int match=FALSE;  /* Pacify gcc */
 
 					/* Look for a parameter */
 					p=s;
diff -apruNU3 unrtf-0.19.3.orig/defs.h unrtf-0.19.3/defs.h
--- unrtf-0.19.3.orig/defs.h	2004-02-18 23:35:02.000000000 +0000
+++ unrtf-0.19.3/defs.h	2004-09-25 04:08:28.000000000 +0000
@@ -37,7 +37,7 @@
  *--------------------------------------------------------------------*/
 
 
-#define PROGRAM_VERSION "0.19.2"
+#define PROGRAM_VERSION "0.19.2  (DJGPP port 2004-09-25 (r1))"
 #define PROGRAM_NAME "UnRTF"
 #define PROGRAM_WEBSITE "http://www.gnu.org/software/unrtf/unrtf.html"
 
diff -apruNU3 unrtf-0.19.3.orig/error.c unrtf-0.19.3/error.c
--- unrtf-0.19.3.orig/error.c	2004-02-18 23:35:02.000000000 +0000
+++ unrtf-0.19.3/error.c	2004-09-25 04:08:28.000000000 +0000
@@ -34,11 +34,12 @@
  * 22 Sep 01, tuorfa@yahoo.com: removed mention of line number in handlers
  * 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks 
  * 08 Oct 03, daved@physiol.usyd.edu.au: added stdlib.h for linux
+ * 25 Sep 04, st001906@hrz1.hrz.tu-darmstadt.de: added stdlib.h for djgpp
  *--------------------------------------------------------------------*/
 
 
 #include <stdio.h>
-#if linux /* daved - 0.19.1 */
+#if linux || __DJGPP__ /* daved - 0.19.1 */
 #include <stdlib.h>
 #endif
 
diff -apruNU3 unrtf-0.19.3.orig/main.c unrtf-0.19.3/main.c
--- unrtf-0.19.3.orig/main.c	2004-02-18 23:35:02.000000000 +0000
+++ unrtf-0.19.3/main.c	2004-09-25 04:08:28.000000000 +0000
@@ -37,13 +37,14 @@
  * 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks 
  * 23 Sep 01, tuorfa@yahoo.com: added wpml switch
  * 08 Oct 03, daved@physiol.usyd.edu.au: added stdlib.h for linux
+ * 25 Sep 04, st001906@hrz1.hrz.tu-darmstadt.de: added stdlib.h for djgpp
  *--------------------------------------------------------------------*/
 
 
 
 #include <stdio.h>
 #include <string.h>
-#if linux /* daved - 0.19.0 */
+#if linux || __DJGPP__ /* daved - 0.19.0 */
 #include <stdlib.h>
 #endif
 
diff -apruNU3 unrtf-0.19.3.orig/output.c unrtf-0.19.3/output.c
--- unrtf-0.19.3.orig/output.c	2004-02-18 23:35:02.000000000 +0000
+++ unrtf-0.19.3/output.c	2004-09-25 04:08:28.000000000 +0000
@@ -31,12 +31,13 @@
  * 22 Sep 01, tuorfa@yahoo.com: addition of functions to change font size
  * 22 Sep 01, tuorfa@yahoo.com: added function-level comment blocks 
  * 08 Oct 03, daved@physiol.usyd.edu.au: added stdlib.h for linux
+ * 25 Sep 04, st001906@hrz1.hrz.tu-darmstadt.de: added stdlib.h for djgpp
  *--------------------------------------------------------------------*/
 
 
 #include <stdio.h>
 #include <string.h>
-#if linux /* daved - 0.19.0 */
+#if linux || __DJGPP__ /* daved - 0.19.0 */
 #include <stdlib.h>
 #endif
 #include "malloc.h"
