mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Use encode::url_part instead of NSString’s deprecated API
While NSString does have a “modern” replacement, it seems simpler to use our own API because we are already dealing with a std::string.
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
#import <io/pipe.h>
|
||||
#import <text/tokenize.h>
|
||||
#import <text/trim.h>
|
||||
#import <text/encode.h>
|
||||
#import <command/runner.h> // bundle_command_t, fix_shebang
|
||||
#import <bundles/wrappers.h>
|
||||
#import <regexp/format_string.h>
|
||||
@@ -226,7 +227,7 @@ static pid_t run_command (dispatch_group_t rootGroup, std::string const& cmd, in
|
||||
|
||||
static NSInteger UniqueKey = 0; // Make each URL unique to avoid caching
|
||||
|
||||
_urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@://job/%@/%ld", kOakFileHandleURLScheme, [to_ns(_bundleCommand.name) stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding], ++UniqueKey]] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:6000];
|
||||
_urlRequest = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@://job/%@/%ld", kOakFileHandleURLScheme, to_ns(encode::url_part(_bundleCommand.name)), ++UniqueKey]] cachePolicy:NSURLRequestReloadIgnoringCacheData timeoutInterval:6000];
|
||||
[NSURLProtocol setProperty:self.identifier forKey:@"commandIdentifier" inRequest:_urlRequest];
|
||||
[NSURLProtocol setProperty:pipe.fileHandleForReading forKey:@"fileHandle" inRequest:_urlRequest];
|
||||
[NSURLProtocol setProperty:@(_processIdentifier) forKey:@"processIdentifier" inRequest:_urlRequest];
|
||||
|
||||
Reference in New Issue
Block a user