Bug 1814 - kpilot vcal conduit corrupts vcs file
Summary: kpilot vcal conduit corrupts vcs file
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: kpilot
Version: 6.0
Hardware: i386
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Preston Brown
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 1999-03-26 14:10 UTC by andrewm
Modified: 2008-05-01 15:37 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 1999-09-23 15:37:50 UTC


Attachments (Terms of Use)

Description andrewm 1999-03-26 14:10:30 UTC
I recently build kpilot 3.1b8 and ran into a snag with the
conduit with
korganizer.  After syncing, korganizer would segfault when
trying to
read the updated .vcs file. I found that the conduit has
split the code
"NEEDS ACTION" into two lines.  A bit of snooping found that
the versit
code in korganizer had a patch for this problem, but the
patch was not
included in kpilot. After applying the patch, kpilot seems
to work
wonderfully.

Martin

--- kpilot-3.1/conduits/vcalconduit/versit/vcc.y.orig	Sat
Jan  9 14:19:30 1999
+++ kpilot-3.1/conduits/vcalconduit/versit/vcc.y	Tue Jan 19
14:10:31 1999
@@ -660,7 +660,10 @@
     lexSkipWhite();
     lexClearToken();
     c = lexLookahead();
-    while (c != EOF && !strchr("\t\n ;:=",c)) {
+    // some "words" have a space in them, like "NEEDS
ACTION".
+    // this may be an oversight of the spec, but it is true
nevertheless.
+    //    while (c != EOF && !strchr("\t\n ;:=",c)) {
+    while (c != EOF && !strchr("\n;:=",c)) {
 	lexAppendc(c);
 	lexSkipLookahead();
 	c = lexLookahead();
@@ -1102,9 +1105,9 @@
 		case '=':
 		    DBG_(("db: EQ\n"));
 		    return EQ;
-		/* ignore whitespace in this mode */
-		case '\t':
-		case ' ': continue;
+		/* ignore tabs/newlines in this mode.  We can't ignore
+		 * spaces, because values like NEEDS ACTION have a space.
*/
+	        case '\t': continue;
 		case '\n': {
 		    ++mime_lineNum;
 		    continue;
@@ -1113,7 +1116,7 @@
 		    break;
 		default: {
 		    lexPushLookaheadc(c);
-		    if (isalpha(c)) {
+		    if (isalpha(c) || c == " ") {
 			char *t = lexGetWord();
 			yylval.str = t;
 			if (!strcasecmp(t, "begin")) {
--- kpilot-3.1/conduits/vcalconduit/versit/Makefile.am.orig
Thu Mar 25 10:59:49 1999
+++ kpilot-3.1/conduits/vcalconduit/versit/Makefile.am	Thu
Mar 25 11:01:05 1999
@@ -28,6 +28,9 @@
 # Which sources should be compiled for kpilot
 libversit_a_SOURCES = vcc.c vobject.c

+$(srcdir)/vcc.c: vcc.y
+	bison $(srcdir)/vcc.y -o $(srcdir)/vcc.c
+
 noinst_HEADERS = port.h vcc.h vobject.h

 # just to make sure, automake makes them

Comment 1 Preston Brown 1999-09-23 15:37:59 UTC
fixed for the next release (with kpilot-3.1b9).


Note You need to log in before you can comment on or make changes to this bug.