Revision: 4662
          http://skim-app.svn.sourceforge.net/skim-app/?rev=4662&view=rev
Author:   hofman
Date:     2008-09-21 11:31:28 +0000 (Sun, 21 Sep 2008)

Log Message:
-----------
Explicitly resolve symlinks in paths involved in tex-sync, as 
stringByStandardizingPath does not do this, even though the docs say it does. 
Also standardize the fileName, because that may also be passed as a 
non-resolved path.

Modified Paths:
--------------
    trunk/SKPDFSynchronizer.m

Modified: trunk/SKPDFSynchronizer.m
===================================================================
--- trunk/SKPDFSynchronizer.m   2008-09-21 00:42:41 UTC (rev 4661)
+++ trunk/SKPDFSynchronizer.m   2008-09-21 11:31:28 UTC (rev 4662)
@@ -260,6 +260,8 @@
 
 - (void)setFileName:(NSString *)newFileName {
     @synchronized(self) {
+        // we compare filenames in canonical form throughout, so we need to 
make sure fileName also is in canonical form
+        newFileName = [[newFileName stringByResolvingSymlinksInPath] 
stringByStandardizingPath];
         if (fileName != newFileName) {
             if ([fileName isEqualToString:newFileName] == NO) {
                 [syncFileName release];
@@ -329,7 +331,8 @@
         file = [file stringByAppendingPathExtension:extension];
     if ([file isAbsolutePath] == NO)
         file = [[[self fileName] stringByDeletingLastPathComponent] 
stringByAppendingPathComponent:file];
-    return [file stringByStandardizingPath];
+    // the docs say -stringByStandardizingPath uses 
-stringByResolvingSymlinksInPath, but it doesn't 
+    return [[file stringByResolvingSymlinksInPath] stringByStandardizingPath];
 }
 
 - (NSString *)sourceFileForFileSystemRepresentation:(const char *)fileRep 
defaultExtension:(NSString *)extension {
@@ -673,7 +676,7 @@
         BOOL success = NO;
         
         file = [self sourceFileForFileName:file 
defaultExtension:SKPDFSynchronizerTexExtension];
-        
+        NSLog(@"%@ %@",[self fileName],file);
         if (isPdfsync)
             success = [self pdfsyncFindPage:&foundPageIndex 
location:&foundPoint forLine:line inFile:file];
         else


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to