not-dash-escaped fix

Werner Koch wk at isil.d.shuttle.de
Sun Jan 10 15:17:11 CET 1999


Here is a patch, so that not-dash-escaped works again. I have uploaded
a signed version of the diff too.

  Werner


Index: g10/armor.c
===================================================================
RCS file: /home/koch/cvs/gnupg/g10/armor.c,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- armor.c	1999/01/09 17:59:49	1.42
+++ armor.c	1999/01/10 14:13:03	1.43
@@ -499,7 +499,8 @@
 	else {
 	    while( len < size && afx->buffer_pos < afx->buffer_len )
 		buf[len++] = afx->buffer[afx->buffer_pos++];
-	    if( afx->buffer_pos >= afx->buffer_len ) {
+	    if( afx->buffer_pos >= afx->buffer_len
+		&& !afx->not_dash_escaped ) {
 		buf[len++] = '\r';
 		buf[len++] = '\n';
 	    }
@@ -518,7 +519,9 @@
 	}
 	if( !maxlen )
 	    afx->truncated++;
-	afx->buffer_len = trim_trailing_spaces( afx->buffer, afx->buffer_len );
+	if( !afx->not_dash_escaped )
+	    afx->buffer_len = trim_trailing_spaces( afx->buffer,
+						    afx->buffer_len );
 	p = afx->buffer;
 	n = afx->buffer_len;
 
@@ -540,7 +543,7 @@
 		    putc('\n', stderr);
 		}
 		lastline = 1;
-		if( len >= 2 )
+		if( len >= 2 && !afx->not_dash_escaped )
 		    len -= 2; /* remove the last CR,LF */
 		rc = -1;
 	    }





More information about the Gnupg-devel mailing list