1. Peter Hosey
  2. Crash Log Viewer

Commits

Peter Hosey  committed 5e29816

Fixed opening Pastie URLs, by fixing the type-detection code to handle URLs without filename extensions.

  • Participants
  • Parent commits 058c2db
  • Branches default

Comments (0)

Files changed (1)

File CLVDocumentController.m

View file
 	else {
 		NSString *path = [URL path];
 		NSString *extension = [path pathExtension];
-		type = [(NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)extension, CFSTR("public.text")) autorelease];
+		if ([extension isEqualToString:@""])
+			type = (NSString *)kUTTypePlainText;
+		else
+			type = [(NSString *)UTTypeCreatePreferredIdentifierForTag(kUTTagClassFilenameExtension, (CFStringRef)extension, kUTTypeText) autorelease];
 	}
 	return type;
 }