aboutsummaryrefslogtreecommitdiffstats
path: root/Source/SPSQLParser.m
diff options
context:
space:
mode:
authorrowanbeentje <rowan@beent.je>2010-09-27 08:36:14 +0000
committerrowanbeentje <rowan@beent.je>2010-09-27 08:36:14 +0000
commit68a2f6250684d9bd51f6281c9bcbb20b10d26876 (patch)
tree37c6cd454520f54e66a4a08880e3328db383138a /Source/SPSQLParser.m
parent92f1221ab8c8d7d4170f88c37ba02a7f32206424 (diff)
downloadsequelpro-68a2f6250684d9bd51f6281c9bcbb20b10d26876.tar.gz
sequelpro-68a2f6250684d9bd51f6281c9bcbb20b10d26876.tar.bz2
sequelpro-68a2f6250684d9bd51f6281c9bcbb20b10d26876.zip
- Fix support for delimiters at the very end of a query string/file
Diffstat (limited to 'Source/SPSQLParser.m')
-rw-r--r--Source/SPSQLParser.m4
1 files changed, 2 insertions, 2 deletions
diff --git a/Source/SPSQLParser.m b/Source/SPSQLParser.m
index 8173170d..4cb0aaa4 100644
--- a/Source/SPSQLParser.m
+++ b/Source/SPSQLParser.m
@@ -765,14 +765,14 @@ TO_BUFFER_STATE to_scan_string (const char *);
switch((unichar)(long)(*charAtIndex)(self, @selector(_charAtIndex:), currentStringIndex+3)) {
case 'i':
case 'I':
- if([self isMatchedByRegex:@"^(delimiter[ \\t]+(\\S+))(?=\\s)"
+ if([self isMatchedByRegex:@"^(delimiter[ \\t]+(\\S+))(?=\\s|\\Z)"
options:RKLCaseless
inRange:NSMakeRange(currentStringIndex, stringLength - currentStringIndex)
error:nil])
{
// Delimiter command found. Extract the delimiter string itself
- NSArray *delimiterCommandParts = [[self arrayOfCaptureComponentsMatchedByRegex:@"(?i)^(delimiter[ \\t]+(\\S+))(?=\\s)"
+ NSArray *delimiterCommandParts = [[self arrayOfCaptureComponentsMatchedByRegex:@"(?i)^(delimiter[ \\t]+(\\S+))(?=\\s|\\Z)"
range:NSMakeRange(currentStringIndex, stringLength - currentStringIndex)] objectAtIndex:0];
if (delimiter) [delimiter release];
delimiter = [[NSString alloc] initWithString:[delimiterCommandParts objectAtIndex:2]];