Bug 100114 - Backup conduit does not skip database creators per documentation
Summary: Backup conduit does not skip database creators per documentation
Status: RESOLVED FIXED
Alias: None
Product: kpilot
Classification: Applications
Component: General (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: groot
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-23 20:43 UTC by Jason 'vanRijn' Kasper
Modified: 2005-02-28 20:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
fix for kpilot backup not correctly skipping creators (966 bytes, patch)
2005-02-24 05:23 UTC, Jason 'vanRijn' Kasper
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason 'vanRijn' Kasper 2005-02-23 20:43:34 UTC
Version:           4.5.0 (using KDE KDE 3.3.92)
Installed from:    Compiled From Sources
OS:                Linux

It looks like this has broken again.  I'm running 4.5.0 (CVS HEAD), updated from CVS as of a couple of days ago, and I'm trying to get kpilot to not sync Plucker documents.  The creator for these is "Plkr", so I am using "[Plkr]" in the sync-ignore field in the configuration dialog, and yet these databases are still pulled down to filesystem during a HotSync backup.

I'll try to look at this soon....
Comment 1 Jason 'vanRijn' Kasper 2005-02-24 05:22:42 UTC
Found it.  Off by 1 position twice.  =:)  Will attach the diff to fix it.
Comment 2 Jason 'vanRijn' Kasper 2005-02-24 05:23:32 UTC
Created attachment 9806 [details]
fix for kpilot backup not correctly skipping creators
Comment 3 Jason 'vanRijn' Kasper 2005-02-28 20:18:55 UTC
CVS commit by vanrijn: 

- fix for off-by-one-twice bug that was keeping requested databases from
  being skipped
BUGS:100114
CCBUGS:100114


  M +5 -4      hotSync.cc   1.53


--- kdepim/kpilot/kpilot/hotSync.cc  #1.52:1.53
@@ -213,5 +213,5 @@ static inline void initNoBackup(QStringL
                         else
                         {
-                                QCString data =  s.mid(2,4).latin1();
+                                QCString data =  s.mid(1,4).latin1();
                                 unsigned long creator = pi_mktag(data[0],data[1],data[2],data[3]);
                                 dbcreators.append(creator);
@@ -368,8 +368,9 @@ bool BackupAction::checkBackupDirectory(
 
         char buff[8];
+        memset(buff, 0, 8);
         buff[0] = '[';
         set_long( &buff[1], info.creator );
-        buff[6] = ']';
-        buff[7] = '\0';
+        buff[5] = ']';
+        buff[6] = '\0';
         QString creator = QString::fromLatin1( buff );
         info.name[33]='\0';


Comment 4 Jason 'vanRijn' Kasper 2005-02-28 20:18:57 UTC
CVS commit by vanrijn: 

- fix for off-by-one-twice bug that was keeping requested databases from
  being skipped
BUGS:100114
CCBUGS:100114


  M +5 -4      hotSync.cc   1.53


--- kdepim/kpilot/kpilot/hotSync.cc  #1.52:1.53
@@ -213,5 +213,5 @@ static inline void initNoBackup(QStringL
                         else
                         {
-                                QCString data =  s.mid(2,4).latin1();
+                                QCString data =  s.mid(1,4).latin1();
                                 unsigned long creator = pi_mktag(data[0],data[1],data[2],data[3]);
                                 dbcreators.append(creator);
@@ -368,8 +368,9 @@ bool BackupAction::checkBackupDirectory(
 
         char buff[8];
+        memset(buff, 0, 8);
         buff[0] = '[';
         set_long( &buff[1], info.creator );
-        buff[6] = ']';
-        buff[7] = '\0';
+        buff[5] = ']';
+        buff[6] = '\0';
         QString creator = QString::fromLatin1( buff );
         info.name[33]='\0';