Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix for extra dot (.) when calling pathByIncrementingSequenceNumber #4

Merged
merged 1 commit into from

2 participants

@kiancheong

Added extra check for empty extensions before returning.

@Cocoanetics Cocoanetics merged commit 3cf587d into from
@Cocoanetics
Owner

Much obliged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 9, 2012
  1. Added extra check for empty extensions before returning. #3

    Kian Cheong Lim authored
This page is out of date. Refresh to see the latest.
Showing with 4 additions and 0 deletions.
  1. +4 −0 Core/Source/NSString+DTPaths.m
View
4 Core/Source/NSString+DTPaths.m
@@ -84,6 +84,10 @@ - (NSString *)pathByIncrementingSequenceNumber
NSString *nakedName = [baseName pathByDeletingSequenceNumber];
+ if ([extension isEqualToString:@""]) {
+ return [nakedName stringByAppendingFormat:@"(%d)", sequenceNumber+1];
+ }
+
return [[nakedName stringByAppendingFormat:@"(%d)", sequenceNumber+1] stringByAppendingPathExtension:extension];
}
Something went wrong with that request. Please try again.