@@ -647,9 +647,11 @@ standard PropertyList format (not the XML format of OS X), using
647647static NSString *
648648commonRoot (NSString *s1, NSString *s2)
649649{
650+ static BOOL hadFailure = NO ;
650651 NSString *s;
651652 unsigned l;
652653
654+ if (hadFailure) return nil ;
653655 if (nil == s1) return s2;
654656
655657 s = [s1 commonPrefixWithString: s2 options: NSLiteralSearch];
@@ -660,9 +662,11 @@ standard PropertyList format (not the XML format of OS X), using
660662 }
661663 if (0 == l)
662664 {
665+ /* I guess this can happen on windows where paths are on different disks.
666+ */
663667 NSLog (@" Unable to make relative links because projects '%@ ' and '%@ '"
664668 @" share no common prefix." , s1, s2);
665- exit ( 1 ) ;
669+ hadFailure = YES ;
666670 }
667671 return [s substringToIndex: l];
668672}
@@ -1990,8 +1994,13 @@ standard PropertyList format (not the XML format of OS X), using
19901994 file = [project stringByAppendingPathExtension: @" html" ];
19911995 path = [base stringByAppendingPathComponent: file];
19921996 installRoot = commonRoot (installRoot, path);
1993- installLength = [installRoot length ];
1994- if ([base length ] < installLength)
1997+ if (nil == installRoot)
1998+ {
1999+ /* No common root ... use absolute links instead.
2000+ */
2001+ relative = nil ;
2002+ }
2003+ else if ([base length ] < (installLength = [installRoot length ]))
19952004 {
19962005 /* All referenced project documentation is relative to the
19972006 * directory that this project will be installed in.
@@ -2048,7 +2057,7 @@ standard PropertyList format (not the XML format of OS X), using
20482057 {
20492058 p = [k stringByDeletingLastPathComponent ];
20502059 }
2051- if (installRoot )
2060+ if (installDir && relative )
20522061 {
20532062 /* Replace the root part with the prefix
20542063 * to make the path relative.
0 commit comments