1.1.6 released

Gert Doering (gert@greenie.muc.de)
Mon, 5 May 1997 19:34:07 +0200


Hi,

while on this topic: I just released 1.1.6. Only a few new features 
(better logging in cnd.c, added some modem types to modem autodetection,
faxspool/faxq support "priority" now), no bug fixes.

To give you a feel for it, I append the unified diff 1.1.5 -> 1.1.6
below.

gert
------------
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/ChangeLog mgetty-1.1.6/ChangeLog
--- mgetty-1.1.5/ChangeLog	Wed Apr 16 11:06:37 1997
+++ mgetty-1.1.6/ChangeLog	Mon May 5 19:13:33 1997
@@ -1,3 +1,28 @@
+Mon May 05 19:13:14 1997 Gert Doering (gert@greenie)
+
+	* release 1.1.6
+
+	* Makefile: generate version diffs now (finally)
+
+Sat May 03 19:06:17 1997 Gert Doering (gert@greenie)
+
+	* faxlib.c: rewrite modem identify function to use mdm_get_idstring 
+	 for ATI, and maybe ATI1, ATI3, ..., for more detailed information 
+	 about *this* modem type (firmware etc.) [see log files]
+
+	* modem.c: new function: mdm_get_idstring()
+	* modem.c: change mdm_command timeout to 10 seconds
+
+	* cnd.c: add better logging
+
+	* faxlib.c: add recognition of ZyXEL Omni.NET (ATI: 1281/1292)
+
+Thu Apr 17 17:33:40 1997 Gert Doering (gert@greenie)
+
+	* fax/faxq: print "priority" field, if set in the JOB file
+
+	* fax/faxspool: implement -P <priority> option (for faxrunqd)
+
 Wed Apr 16 11:06:03 1997 Gert Doering (gert@greenie)
 
 	* release 1.1.5
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/Makefile mgetty-1.1.6/Makefile
--- mgetty-1.1.5/Makefile	Sun Apr 13 22:20:42 1997
+++ mgetty-1.1.6/Makefile	Mon May 5 19:19:32 1997
@@ -1,6 +1,6 @@
 # Makefile for the mgetty fax package
 #
-# SCCS-ID: %W% %E% (c) Gert Doering
+# SCCS-ID: @(#)Makefile	4.4 97/05/05 (c) Gert Doering
 #
 # this is the C compiler to use (on SunOS, the standard "cc" does not
 # grok my code, so please use gcc there. On ISC 4.0, use "icc".).
@@ -282,7 +282,8 @@
 # Nothing to change below this line ---------------------------------!
 #
 MR=1.1
-SR=5
+SR=6
+DIFFR=1.1.5
 #
 #
 OBJS=mgetty.o logfile.o do_chat.o locks.o utmp.o logname.o login.o \
@@ -441,6 +442,20 @@
 
 tar:	mgetty$(MR).$(SR).tar.gz
 
+diff:	mgetty$(DIFFR)-$(MR).$(SR).diff
+
+mgetty$(DIFFR)-$(MR).$(SR).diff: \
+	mgetty$(DIFFR).tar.gz mgetty$(MR).$(SR).tar.gz
+	-rm -rf /tmp/mgd
+	mkdir /tmp/mgd
+	gtar xvCfz /tmp/mgd mgetty$(DIFFR).tar.gz
+	gtar xvCfz /tmp/mgd mgetty$(MR).$(SR).tar.gz
+	( cd /tmp/mgd ; \
+	 gdiff -u3 +ignore-space-change +recursive +new-file \
+		mgetty-$(DIFFR) mgetty-$(MR).$(SR) ; \
+		exit 0 ) >mgetty$(DIFFR)-$(MR).$(SR).diff
+	rm -rf /tmp/mgd
+
 mg.uue:	mgetty$(MR).$(SR).tar.gz
 	uuencode mgetty$(MR).$(SR)-`date +%b%d`.tar.gz <mgetty$(MR).$(SR).tar.gz >mg.uue
 
@@ -452,13 +467,13 @@
 # this is for automatic uploading to the beta site. 
 # DO NOT USE IT if you're not ME! Please!
 #
-beta:	mgetty$(MR).$(SR).tar.gz
+beta:	mgetty$(MR).$(SR).tar.gz diff
 	test `hostname` = greenie.muc.de || exit 1
 # local
 	cp mgetty$(MR).$(SR).tar.gz /pub/uploads/
 
 # beta ftp site
-	-./ftp.sh $(MR).$(SR) hprbg7.informatik.tu-muenchen.de \
+	-./ftp.sh $(MR).$(SR) hp2 \
 		'~ftp/pub/comp/networking/communication/modem/mgetty' && \
 	ssh hp2 -l doering 'cd $$HOME ; ./beta'
 
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/TODO mgetty-1.1.6/TODO
--- mgetty-1.1.5/TODO	Sun Apr 6 20:02:14 1997
+++ mgetty-1.1.6/TODO	Sun May 4 13:24:16 1997
@@ -277,3 +277,6 @@
 205) vgetty on AIX: make sure VTIME is not set != 0 while waiting with
 select() or poll() -- drivers are dumb and use VTIME for timeout, 
 not the value passed to select()... *sigh*
+
+206) if "Dr.Neuhaus SMARTY" is detected, set some flag to prevent
+  switching back to +fclass=0 ("modem_quirks |= NEED_2"?)
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/cnd.c mgetty-1.1.6/cnd.c
--- mgetty-1.1.5/cnd.c	Sun Jan 12 14:54:29 1997
+++ mgetty-1.1.6/cnd.c	Sun May 4 12:20:22 1997
@@ -1,4 +1,4 @@
-#ident "@(#)cnd.c	@(#)cnd.c	4.1 97/01/12 Copyright (c) 1993 Gert Doering/Chris Lewis"
+#ident "@(#)cnd.c	@(#)cnd.c	4.3 97/05/04 Copyright (c) 1993 Gert Doering/Chris Lewis"
 
 #include <stdio.h>
 #include <string.h>
@@ -187,6 +187,8 @@
 
  process_rockwell_mesg();		/* parse ugly rockwell msg */
 
+ lprintf(L_JUNK, "CND: check no: '%s'", CallerID );
+
  while (fgets(buf, sizeof(buf), cndfile)) {
 	register char *p = buf, *p2;
 	while(isspace(*p)) p++;
@@ -198,12 +200,13 @@
 	 if (!match)
 		p2++;
 
+	 lprintf(L_JUNK, "CND: check vs: %s", p2);
+
 	 if (strcmp(p2, "all") == 0)
 		goto leave;
 	 if (strncmp(p2, CallerId, strlen(p2)) == 0)
 		goto leave;
 
-	 lprintf(L_JUNK, "CND: number: %s", p2);
 	 p = NULL;
 	}
  }
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/doc/faxspool.1in mgetty-1.1.6/doc/faxspool.1in
--- mgetty-1.1.5/doc/faxspool.1in	Sun Jan 12 14:52:39 1997
+++ mgetty-1.1.6/doc/faxspool.1in	Thu Apr 17 17:33:30 1997
@@ -114,6 +114,15 @@
 page header file with it, and it will be passed to the cover page program
 (if used) as <sender-NAME>.
 .TP
+.B -P <priority>
+Sets the priority of the fax in the queue. 9 is highest (meaning: faxes
+get sent out first), 1 is lowest. If nothing is specified, a default
+value of 5 is used. Right now, only
+.I faxrunqd
+understands priority,
+.I faxrunq
+will silently ignore it.
+.TP
 .B -C <cover page program>
 Specify that the named program is to be used to generate a cover page for
 the fax that is being queued. How the program is called is described in the
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/doc/mgetty.8in mgetty-1.1.6/doc/mgetty.8in
--- mgetty-1.1.5/doc/mgetty.8in	Mon Feb 17 21:34:16 1997
+++ mgetty-1.1.6/doc/mgetty.8in	Thu May 1 13:21:35 1997
@@ -154,12 +154,16 @@
 
 
 .SH BUGS
+Not all of
 .I mgetty
-configuration is horrible. Dozens of switches, and compile-time stuff. It
-*really* should be fully run-time configurable.
+configuration can be done at run-time yet. Things like flow control and
+file paths (log file / lock file) have to be configured by changing the
+source and recompiling.
 
+Users never read manuals...
+
 .SH "SEE ALSO"
-g32pbm(1), sendfax(8), getty(8), mgettydefs(4)
+g32pbm(1), sendfax(8), getty(8), mgettydefs(4), mgetty.info
 .SH AUTHOR
 .I mgetty
 is Copyright (C) 1993 by Gert Doering, <gert@greenie.muc.de>.
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/doc/mgetty.texi-in mgetty-1.1.6/doc/mgetty.texi-in
--- mgetty-1.1.5/doc/mgetty.texi-in	Wed Apr 2 23:11:58 1997
+++ mgetty-1.1.6/doc/mgetty.texi-in	Thu May 1 11:41:43 1997
@@ -3620,7 +3620,7 @@
 
 The current release can usually be found at:
 
-sunsite.unc.edu:@file{/pub/Linux/system/Serial/mgetty+sendfax*}
+sunsite.unc.edu:@file{/pub/Linux/system/serial/getty/mgetty+sendfax*}
 
 tsx-11.mit.edu:@file{/pub/linux/sources/sbin/mgetty+sendfax*}
 
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/doc/modems.db mgetty-1.1.6/doc/modems.db
--- mgetty-1.1.5/doc/modems.db	Sat Mar 22 12:09:17 1997
+++ mgetty-1.1.6/doc/modems.db	Wed Apr 16 11:21:46 1997
@@ -721,6 +721,11 @@
     But only good for stable telefon lines, not very good
     at scratchy or analog connections.
 
+			If you have caller ID on your phone line, add
+			AT#CID=1 to your init chat sequence, and mgetty
+			will be able to write the Caller ID to the log
+			files.
+
 contributor:  kuerten@informatik.tu-muenchen.de
 contributor:  rrb@cqs.ch
 
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/fax/faxq.in mgetty-1.1.6/fax/faxq.in
--- mgetty-1.1.5/fax/faxq.in	Sun Jan 12 14:54:13 1997
+++ mgetty-1.1.6/fax/faxq.in	Thu Apr 24 15:09:23 1997
@@ -4,7 +4,7 @@
 #
 # like "lpq" or "mailq", show jobs waiting in the output queue
 #
-# SCCS: @(#)faxq.in	4.1 97/01/12 Copyright (C) 1994 Gert Doering
+# SCCS: @(#)faxq.in	4.2 97/04/24 Copyright (C) 1994 Gert Doering
 #
 FAX_SPOOL=@FAX_SPOOL@
 FAX_SPOOL_OUT=@FAX_SPOOL_OUT@
@@ -54,14 +54,16 @@
 [ -z "$jobs" ] && $echo "no jobs."
 for i in $jobs
 do
- USER=""; PHONE=""; PAGES=""; MAILTO=""; VERBTO=""; ACCT=""; INPUT=""; RE=""
+ USER=""; PHONE=""; PAGES=""; MAILTO=""; VERBTO=""; 
+ ACCT=""; INPUT=""; PRI=""; RE=""
 
  if [ -z "$verbose" ]
  then
 	eval `$AWK '$1=="user" { printf "USER=%s;", $2 }
 		 $1=="phone" { printf "PHONE=%s;", $2 }
-		 $1=="pages" { printf "PAGES=%d;", NF-1 }' $i`
-	$echo "$i: queued by $USER. $PAGES page(s) to $PHONE"
+		 $1=="pages" { printf "PAGES=%d;", NF-1 }
+		 $1=="priority" { printf "PRI=\" pri=%s.\"", $2}' $i`
+	$echo "$i: queued by $USER. $PAGES page(s) to $PHONE.$PRI"
  else
 	eval `$AWK '$1=="user" { printf "USER=%s;", $2 }
 		 $1=="mail" { printf "MAILTO=\"%s\";", substr( $0, 6 ) }
@@ -74,6 +76,7 @@
 		 $1=="time" { printf "TIME=\"%s:%s\";",
 				 substr( $0, 6, 2 ), substr( $0, 8,2 ) }
 		 $1=="subject"{ printf "RE=\"%s\";", substr( $0, 9 ) }
+		 $1=="priority"{ printf "PRI=\"%s\";", $2 }
 		 $1=="pages" { if ( NF==2 ) printf "PAGES=\"%s\";", $2
 				 else if ( NF==3 )
       printf "PAGES=\"%s %s\";", $2, $3
@@ -99,6 +102,8 @@
 	$echo "\tSend time: $TIME"
  test ! -z "$ACCT" && \
 	$echo "\tAcct info: $ACCT"
+  test ! -z "$PRI" && \
+	$echo "\t Priority: $PRI"
 
 	sed -e '/Status/!d' -e 's/Status/   Status:/' $i
  if [ -f "$i.locked" ] ; then
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/fax/faxspool.in mgetty-1.1.6/fax/faxspool.in
--- mgetty-1.1.5/fax/faxspool.in	Tue Mar 18 23:02:53 1997
+++ mgetty-1.1.6/fax/faxspool.in	Thu Apr 17 17:30:40 1997
@@ -3,7 +3,7 @@
 # faxspool - sample script how to spool fax input data to a spool
 #  directory, creating jobs to be run by faxrunq
 #
-# sccsid: @(#)faxspool.in	4.2 97/03/18 (c) Gert Doering
+# sccsid: @(#)faxspool.in	4.3 97/04/17 (c) Gert Doering
 #
 # syntax: faxspool [flags] <phone-number> <job(s)>
 #
@@ -333,6 +333,7 @@
 normal_res=""
 TIME=""
 copy_source=""
+job_priority=""
 
 #
 # get command line arguments (overriding some of the values above)
@@ -347,6 +348,7 @@
 \t-F <full name>\tset full name of sender
 \t-h <file>\ttext file for page header
 \t-f <email>\tset address for status mail
+\t-P <n>\t set job priority (1=lowest, 9=highest)
 \t-c\t\tcopy source files
 \t-t <hh:mm>\tset earliest possible send time
 \t-t <hh:mm-hh:mm> set time range for sending fax
@@ -384,6 +386,14 @@
   FULLNAME="$2"
 	 shift ; shift
 	 ;;
+# set job priority (1=lowest, 9=highest)
+  -P) case "$2" in
+	 [1-9]) ;;
+	 *) $echo "$usage" >&2 ; exit 2 ;;
+  esac
+  job_priority="$2"
+	 shift ; shift
+	 ;;
 # set page header text file
 	-h) case "$2" in
 	 '') $echo "$usage" >&2 ; exit 2 ;;
@@ -881,6 +891,9 @@
 
 [ -z "$normal_res" ] || \
  $echo "normal_res" >>$job.q
+
+[ -z "$job_priority" ] || \
+ $echo "priority $job_priority" >>$job.q
 
 [ -z "$TIME" ] || \
  $echo "time $TIME" >>$job.q
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/faxlib.c mgetty-1.1.6/faxlib.c
--- mgetty-1.1.5/faxlib.c	Wed Apr 16 11:05:52 1997
+++ mgetty-1.1.6/faxlib.c	Sun May 4 13:09:25 1997
@@ -1,4 +1,4 @@
-#ident "@(#)faxlib.c	4.6 97/04/12 Copyright (c) Gert Doering"
+#ident "@(#)faxlib.c	4.9 97/05/04 Copyright (c) Gert Doering"
 
 /* faxlib.c
 *
@@ -494,22 +494,21 @@
 int mdm_identify _P1( (fd), int fd )
 {
  char * l, *p;
- int mid;
+ char * mis = NULL;		/* more verbose modem ID string */
 
  modem_type=Mt_unknown;
  
- signal( SIGALRM, fwf_sig_alarm ); alarm(20); fwf_timeout = FALSE;
-
- if ( mdm_send( "ATI", fd ) == ERROR ) return ERROR;
+ /* try ATI first, ATI<n> later to sub-divide results
+  */
+ l = mdm_get_idstring( "ATI", 1, fd );
 
- while(1)
+ if ( l == NULL ) 
  {
-	l = mdm_get_line( fd );
-	if ( l == NULL ) break;
+	lprintf( L_WARN, "mdm_identify: can't get modem ID" );
+	return ERROR;
+ }
 
 	lprintf( L_NOISE, "mdm_identify: string '%s'", l );
-	if ( strcmp( l, "OK" ) == 0 || strcmp( l, "ERROR" ) == 0 ) break;
-	if ( strcmp( l, "ATI" ) == 0 ) continue;
 
 	/* all-numerical? */
 	p = l;
@@ -517,7 +516,7 @@
 
 	if ( *p == '\0' )		/* all-numeric */
 	{
-	 mid = atoi(l);
+	int mid = atoi(l);	/* numerical modem ID... */
 
 	 switch(mid)
 	 {
@@ -524,24 +523,37 @@
 	 case 1496:
 		lprintf( L_MESG, "ZyXEL 1496 detected" ); 
 		modem_type=Mt_class2_0;
+	 mis = mdm_get_idstring( "ATI1", 2, fd );
 		break;
 	 case 2864:
 		lprintf( L_MESG, "ZyXEL 2864(D) detected" );
 		modem_type=Mt_class2_0;
+	 mis = mdm_get_idstring( "ATI1", 2, fd );
 		break;
 	 case 28641:
 	 case 28642:
 		lprintf( L_MESG, "ZyXEL 2864I(D) detected" );
 		modem_type=Mt_class2_0;
+	 mis = mdm_get_idstring( "ATI1", 2, fd );
 		break;
+	 case 1281:
+	 case 1291:
+	 case 1292:
+	 case 1293:
+	 lprintf( L_MESG, "ZyXEL Omni.NET detected" );
+	 modem_type=Mt_data;				/* has no fax mode */
+	 mis = mdm_get_idstring( "ATI1", 1, fd );
+	 break;
 	 case 6401:
 		lprintf( L_MESG, "USR I-Modem detected" );
 		modem_type=Mt_class2_0;
+	 mis = mdm_get_idstring( "ATI3", 1, fd );
 		break;
 	 case 2886:
 	 case 3366:
 		lprintf( L_MESG, "USR Courier V.34(+) detected" );
 		modem_type=Mt_class2_0;
+	 mis = mdm_get_idstring( "ATI3", 1, fd );
 		break;
 	 case 1444:
 	 case 1445:
@@ -549,8 +561,10 @@
 		modem_type=Mt_data;
 		break;
 	 case 62:	/* sure? */
+	 case 962:
 		lprintf( L_MESG, "Dr. Neuhaus Smarty detected (?)" );
-		modem_type=Mt_class2;
+	 modem_type=Mt_class2;	/* now do ATI9! */
+	 mis = mdm_get_idstring( "ATI9", 1, fd );
 		break;
 	 case 184:	/* sure? */
 		lprintf( L_MESG, "Telebit FastBlazer detected" );
@@ -560,9 +574,10 @@
 		lprintf( L_MESG, "Intel 14.4E/400e detected (??)" );
 		modem_type=Mt_unknown;
 		break;
-	 case 247: /* sure? - use ATI2 for further distinction */
+	 case 247: /* use ATI2 for further distinction */
 		lprintf( L_MESG, "Multitech MT1432BA/MT1932ZDX/MT2834ZDX detected" );
 		modem_type=Mt_class2_0;
+	 mis = mdm_get_idstring( "ATI2", 1, fd );
 		break;
 	 case 251: /* sure? */
 		lprintf( L_MESG, "Discovery 2400 AM detected" );
@@ -571,6 +586,12 @@
 	 case 641: /* sure? */
 		lprintf( L_MESG, "ELSA MicroLink ISDN/TLpro detected" );
 		modem_type=Mt_data;
+	 mis = mdm_get_idstring( "ATI3", 1, fd );
+	 break;
+	 case 282:	/* ATI6/ATI3 for model/firmware info */
+	 lprintf( L_MESG, "ELSA MicroLink 28.8 TQV detected" );
+	 modem_type=Mt_class2_0;
+	 mis = mdm_get_idstring( "ATI3", 1, fd );
 		break;
 	 case 249:
 	 case 14400: /* further distinction necessary (ATI4)! */
@@ -578,6 +599,8 @@
 	 case 33600:
 		lprintf( L_MESG, "Generic Rockwell modem (%d)", mid );
 		modem_type=Mt_class2;
+	 mis = mdm_get_idstring( "ATI3", 1, fd );
+	 mis = mdm_get_idstring( "ATI4", 1, fd );
 		break;
 	 default:
 		lprintf( L_MESG, "unknown numerical modem id %d", mid );
@@ -600,16 +623,9 @@
 		modem_type=Mt_data;
 	 }
 	}
- }
-
- alarm(0); signal( SIGALRM, SIG_DFL );
  
- if ( l == NULL || strcmp( l, "ERROR" ) == 0 )
- {
-	lputs( L_MESG, " -> ERROR" );
-	return ERROR;
- }
- lputs( L_MESG, " -> OK" );
+ if ( mis != NULL ) 
+	lprintf( L_MESG, "additional info: '%s'", mis );
 	
  return NOERROR;
 }
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/ftp.sh mgetty-1.1.6/ftp.sh
--- mgetty-1.1.5/ftp.sh	Sun Apr 13 22:25:35 1997
+++ mgetty-1.1.6/ftp.sh	Mon May 5 19:10:52 1997
@@ -17,6 +17,10 @@
  DST=mgetty+sendfax-$VS.tar.gz
 fi
 
+# find diff's, if any...
+DIFF=`ls -rt mgetty*-$VS.diff 2>/dev/null |tail -1`
+test -n "$DIFF" && DIFF="put $DIFF"
+
 # normal FTP upload
 ftp -v $HOST <<EOF
 cd $DIR
@@ -23,5 +27,6 @@
 bin
 hash
 put $SRC $DST
+$DIFF
 quit
 EOF
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/mgetty.h mgetty-1.1.6/mgetty.h
--- mgetty-1.1.5/mgetty.h	Mon Mar 31 21:03:15 1997
+++ mgetty-1.1.6/mgetty.h	Sun May 4 12:51:15 1997
@@ -1,7 +1,7 @@
 #ifndef ___MGETTY_H
 #define ___MGETTY_H
 
-#ident "@(#)mgetty.h	4.2 97/03/31 Copyright (c) Gert Doering"
+#ident "@(#)mgetty.h	4.3 97/05/04 Copyright (c) Gert Doering"
 
 /* mgetty.h
 *
@@ -223,6 +223,7 @@
 int	mdm_read_byte _PROTO(( int fd, char * c ));
 char *	mdm_get_line _PROTO(( int fd ));
 int	mdm_command _PROTO(( char * send, int fd ));
+char * mdm_get_idstring _PROTO(( char * send, int n, int fd ));
 
 /* logname.c */
 char *	ln_escape_prompt _PROTO(( char * prompt ));
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/modem.c mgetty-1.1.6/modem.c
--- mgetty-1.1.5/modem.c	Sat Apr 12 17:51:11 1997
+++ mgetty-1.1.6/modem.c	Sun May 4 13:09:24 1997
@@ -1,4 +1,4 @@
-#ident "@(#)modem.c	4.2 97/01/15 Copyright (c) Gert Doering"
+#ident "@(#)modem.c	4.3 97/05/04 Copyright (c) Gert Doering"
 
 /* modem.c
 *
@@ -105,7 +105,7 @@
  /* wait for OK or ERROR, *without* side effects (as fax_wait_for
 * would have)
 */
- signal( SIGALRM, fwf_sig_alarm ); alarm(20); fwf_timeout = FALSE;
+ signal( SIGALRM, fwf_sig_alarm ); alarm(10); fwf_timeout = FALSE;
 
  do
  {
@@ -155,3 +155,48 @@
  return 1;
 }
 
+/* for modem identify (and maybe other nice purposes, who knows)
+ * this function is handy:
+ * - send some AT command, wait for OK/ERROR or 10 seconds timeout
+ * - return a pointer to a static buffer holding the "nth" non-empty
+ * answer line from the modem (for multi-line responses), or the 
+ * last line if n==-1
+ */
+char * mdm_get_idstring _P3( (send, n, fd), char * send, int n, int fd )
+{
+ char * l; int i;
+ static char rbuf[80];
+
+ if ( mdm_send( send, fd ) == ERROR ) return NULL;
+
+ /* wait for OK or ERROR, *without* side effects (as fax_wait_for
+  * would have)
+  */
+ signal( SIGALRM, fwf_sig_alarm ); alarm(10); fwf_timeout = FALSE;
+
+ i=0;
+ rbuf[0] = '\0';
+
+ while(1)
+ {
+	l = mdm_get_line( fd );
+
+	if ( l == NULL ) break;				/* error */
+	if ( strcmp( l, send ) == 0 ) continue;		/* command echo */
+
+  if ( strcmp( l, "OK" ) == 0 ||			/* final string */
+	  strcmp( l, "ERROR" ) == 0 ) break;
+
+  i++;
+	lprintf( L_NOISE, "mdm_gis: string %d: '%s'", i, l );
+
+	if ( i==-1 || i==n )		/* copy string */
+	 { strncpy( rbuf, l, sizeof(rbuf)-1); rbuf[sizeof(rbuf)-1]='\0'; }
+ }
+
+ alarm(0); signal( SIGALRM, SIG_DFL );
+ 
+ if ( l == NULL ) return NULL;	/* error */
+
+ return rbuf;
+}
diff -u3 +ignore-space-change +recursive +new-file mgetty-1.1.5/version.h mgetty-1.1.6/version.h
--- mgetty-1.1.5/version.h	Wed Apr 16 11:06:40 1997
+++ mgetty-1.1.6/version.h	Mon May 5 19:19:33 1997
@@ -1 +1 @@
-char * mgetty_version = "experimental test release 1.1.5-Apr16";
+char * mgetty_version = "experimental test release 1.1.6-May05";
-- 
USENET is *not* the non-clickable part of WWW!
           //www.muc.de/~gert/
Gert Doering - Munich, Germany      gert@greenie.muc.de
fax: +49-89-3545980     gert.doering@physik.tu-muenchen.de
.