Chromium Code Reviews| Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm |
| diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm |
| index 38b5a4eb096fa65e07d52d5f8fb25f937ec238be..60b72df0b8c42372eec989a8fe84f7319cd64fb9 100644 |
| --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm |
| +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm |
| @@ -722,11 +722,11 @@ static BOOL FileAlreadyExists(NSURL* base, NSString* name) { |
| // Takes a destination URL, a suggested file name, & an extension (eg .webloc). |
| // Returns the complete file name with extension you should use. |
| -// The name returned will not contain /, : or ?, will not be longer than |
| -// kMaxNameLength + length of extension, and will not be a file name that |
| -// already exists in that directory. If necessary it will try appending a space |
| -// and a number to the name (but before the extension) trying numbers up to and |
| -// including kMaxIndex. |
| +// The name returned will not contain /, : or ?, will not start with a dot, |
| +// will not be longer than kMaxNameLength + length of extension, and will not |
| +// be a file name that already exists in that directory. If necessary it will |
| +// try appending a space and a number to the name (but before the extension) |
| +// trying numbers up to and including kMaxIndex. |
| // If the function gives up it returns nil. |
| static NSString* UnusedLegalNameForNewDropFile(NSURL* saveLocation, |
| NSString *fileName, |
| @@ -741,6 +741,8 @@ static NSString* UnusedLegalNameForNewDropFile(NSURL* saveLocation, |
| withString:@"-"]; |
| filteredName = [filteredName stringByReplacingOccurrencesOfString:@"?" |
| withString:@"-"]; |
| + filteredName = [filteredName stringByReplacingOccurrencesOfString:@"." |
| + withString:@"-" options:0 range:NSMakeRange(0,1)]; |
|
Scott Hess - ex-Googler
2015/06/09 20:37:29
http://google-styleguide.googlecode.com/svn/trunk/
|
| if ([filteredName length] > kMaxNameLength) |
| filteredName = [filteredName substringToIndex:kMaxNameLength]; |