Commits

Peter Hosey committed 5e29816

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

Comments (0)

Files changed (1)

CLVDocumentController.m

 	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;
 }