Revision: 16727
          http://sourceforge.net/p/skim-app/code/16727
Author:   hofman
Date:     2026-10-27 16:17:37 +0000 (Tue, 27 Oct 2026)
Log Message:
-----------
determine whether we expect a directory URL

Modified Paths:
--------------
    trunk/SKMainDocument.m
    trunk/SKTemplateManager.m

Modified: trunk/SKMainDocument.m
===================================================================
--- trunk/SKMainDocument.m      2026-10-27 16:05:18 UTC (rev 16726)
+++ trunk/SKMainDocument.m      2026-10-27 16:17:37 UTC (rev 16727)
@@ -630,7 +630,7 @@
             if ([ourExtensions containsObject:[[url pathExtension] 
lowercaseString]] == NO) {
                 if (tmpURL == nil)
                     tmpURL = [fm URLForDirectory:NSItemReplacementDirectory 
inDomain:NSUserDomainMask appropriateForURL:fileURL create:YES error:NULL];
-                [fm copyItemAtURL:url toURL:[tmpURL 
URLByAppendingPathComponent:[url lastPathComponent] isDirectory:NO] error:NULL];
+                [fm copyItemAtURL:url toURL:[tmpURL 
URLByAppendingPathComponent:[url lastPathComponent] isDirectory:[[url 
absoluteString] hasSuffix:@"/"]] error:NULL];
             }
         }
     }
@@ -669,7 +669,7 @@
             // move extra package content like version info to the new location
             NSFileManager *fm = [NSFileManager defaultManager];
             for (NSURL *url in [fm contentsOfDirectoryAtURL:tmpURL 
includingPropertiesForKeys:@[] options:0 error:NULL])
-                [fm moveItemAtURL:url toURL:[absoluteURL 
URLByAppendingPathComponent:[url lastPathComponent] isDirectory:NO] error:NULL];
+                [fm moveItemAtURL:url toURL:[absoluteURL 
URLByAppendingPathComponent:[url lastPathComponent] isDirectory:[[url 
absoluteString] hasSuffix:@"/"]] error:NULL];
         }
     } else if ([attributes count]) {
         [attributes enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL 
*stop){

Modified: trunk/SKTemplateManager.m
===================================================================
--- trunk/SKTemplateManager.m   2026-10-27 16:05:18 UTC (rev 16726)
+++ trunk/SKTemplateManager.m   2026-10-27 16:17:37 UTC (rev 16727)
@@ -123,7 +123,7 @@
         return nil;
     
     for (NSURL *appSupportURL in [[fm applicationSupportDirectoryURLs] 
arrayByAddingObject:[[NSBundle mainBundle] sharedSupportURL]]) {
-        url = [[appSupportURL URLByAppendingPathComponent:TEMPLATES_DIRECTORY 
isDirectory:YES] URLByAppendingPathComponent:file isDirectory:NO];
+        url = [[appSupportURL URLByAppendingPathComponent:TEMPLATES_DIRECTORY 
isDirectory:YES] URLByAppendingPathComponent:file isDirectory:[[file 
pathExtension] isCaseInsensitiveEqual:@"rtfd"]];
         if ([url checkResourceIsReachableAndReturnError:NULL] == NO)
             url = nil;
         else break;

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



_______________________________________________
Skim-app-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/skim-app-commit

Reply via email to