Bug 73020

Summary: qpage runs words together
Product: Ports & Packages Reporter: rand
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description rand 2004-10-23 01:10:23 UTC
	The qpage port will run words together in long pages. The problem
	is in msgcpy in util.c, where the breaks don't preserve word
	boundries.

Fix: Add this patch file to the port. I've also submitted it to the
	author of qpage.

How-To-Repeat: 	qpage -p USER -f USER "this is a test of a message where two words will have the white space between them removed"
	results in this page being delivered:
	USER: this is a test of a message where two words will have the whitespace between them removed
	(Notice that "white space" became "whitespace", and no I didn't plan my test
	case that carefully. :))
Comment 1 rand 2004-10-23 01:13:03 UTC
Sigh. My patch is slightly broken. I wrote:

--- /tmp/ports/a/Agena/usr/ports/comms/qpage/work/qpage-3.3/util.c-orig	Fri Oct 22 18:57:00 2004
+++ /tmp/ports/a/Agena/usr/ports/comms/qpage/work/qpage-3.3/util.c	Fri Oct 22 18:57:04 2004
@@ -537,7 +537,7 @@
 	** Now make sure we didn't chop a word in the middle.
 	*/
 	if (*src && end) {
-		*end++ = '\0';
+		*++end = '\0';
 		src = start;
 	}
 

And of course the absolute path names should not be there. Sorry about
that. This patch should work better:

--- util.c-orig	Fri Oct 22 18:57:00 2004
+++ util.c	Fri Oct 22 18:57:04 2004
@@ -537,7 +537,7 @@
 	** Now make sure we didn't chop a word in the middle.
 	*/
 	if (*src && end) {
-		*end++ = '\0';
+		*++end = '\0';
 		src = start;
 	}
Comment 2 Pav Lucistnik freebsd_committer freebsd_triage 2004-10-28 23:03:36 UTC
State Changed
From-To: open->closed

Committed, thanks!