[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[coldsync-hackers] ColdSync.pm patch




If you invoke a conduit with a relative path (for example, "./my-conduit 
  -config"), the "-config" output will have the relative path in it, 
which might be wrong. One could do nicer (for example, change 
"foo/bar/.." into just "foo"), but this at least doesn't produce 
incorrect output.

--- ColdSync.pm 2 Apr 2002 15:33:04 -0000       1.18
+++ ColdSync.pm 16 Oct 2002 14:45:16 -0000
@@ -153,6 +153,15 @@ sub DumpConfig
         my $type;
         my @typestrings = ();
         my $typestring;
+       my $path = $0;
+
+       if($path =~ m|^[^/].*/|) {
+         $path =~ s|^\./||;
+         $path = $ENV{'PWD'} . '/' . $path;
+       }
+
+       $path =~ s|^\./||;
+

         foreach $creator (keys %Palm::PDB::PDBHandlers)
         {
@@ -169,7 +178,7 @@ sub DumpConfig
         print "conduit ", join(",", @flavors), " {\n";
                         # Print the "conduit" directive and the list of
                         # flavors
-       print "\tpath: \"$0\";\n";
+       print "\tpath: \"$path\";\n";
                         # Print path to the conduit

         # Print the list of types that this conduit supports.

-- 
Pierre Phaneuf
http://advogato.org/person/pphaneuf/


-- 
This message was sent through the coldsync-hackers mailing list.  To remove
yourself from this mailing list, send a message to majordomo@thedotin.net
with the words "unsubscribe coldsync-hackers" in the message body.  For more
information on Coldsync, send mail to coldsync-hackers-owner@thedotin.net.