Revision: 13802
          http://sourceforge.net/p/skim-app/code/13802
Author:   hofman
Date:     2023-11-25 10:26:21 +0000 (Sat, 25 Nov 2023)
Log Message:
-----------
make sure service name is less than 128 characters long

Modified Paths:
--------------
    trunk/SkimNotes/SKNXPCSkimReader.m

Modified: trunk/SkimNotes/SKNXPCSkimReader.m
===================================================================
--- trunk/SkimNotes/SKNXPCSkimReader.m  2023-11-24 23:31:20 UTC (rev 13801)
+++ trunk/SkimNotes/SKNXPCSkimReader.m  2023-11-25 10:26:21 UTC (rev 13802)
@@ -98,8 +98,12 @@
         NSString *bundleIdentifier = [[NSBundle mainBundle] bundleIdentifier];
         
         // can also use a fixed identifier, or let the tool decide about an 
identifier and read it from stdout
-        if (nil == [self agentIdentifier])
-            [self setAgentIdentifier:[NSString 
stringWithFormat:@"%@.skimnotes-%@@", bundleIdentifier, [[NSProcessInfo 
processInfo] globallyUniqueString]]];
+        if (nil == [self agentIdentifier]) {
+            NSString *identifier = [NSString 
stringWithFormat:@"%@.skimnotes-%@", bundleIdentifier, [[NSProcessInfo 
processInfo] globallyUniqueString]];
+            if ([identifier length] > 127)
+                identifier = [identifier substringFromIndex:[identifier 
length] - 127];
+            [self setAgentIdentifier:identifier];
+        }
         
         NSArray *arguments = @[launchPath, @"agent", @"-xpc", [self 
agentIdentifier]];
 

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