Revision: 22181
          http://sourceforge.net/p/bibdesk/svn/22181
Author:   hofman
Date:     2018-04-11 17:16:57 +0000 (Wed, 11 Apr 2018)
Log Message:
-----------
initialize array

Modified Paths:
--------------
    trunk/bibdesk/BDSKMathSciNetParser.m

Modified: trunk/bibdesk/BDSKMathSciNetParser.m
===================================================================
--- trunk/bibdesk/BDSKMathSciNetParser.m        2018-04-11 09:50:29 UTC (rev 
22180)
+++ trunk/bibdesk/BDSKMathSciNetParser.m        2018-04-11 17:16:57 UTC (rev 
22181)
@@ -150,9 +150,7 @@
     
     // Downloaded BibTeX records sometimes use \"o for umlauts which is 
incorrect and rejected by the parser. Use a regular expression to find and 
replace them. Also add brackets to acute and grave accents, so BibDesk 
translates them to Unicode properly for display.
     AGRegex * umlautFixer = [AGRegex regexWithPattern:@"(\\\\[\"'`][a-zA-Z])" 
options:AGRegexMultiline];
-    // Downloaded BibTeX records sometimes have a comma after the last field
-    AGRegex * lastCommaFixer = [AGRegex regexWithPattern:@"\\},[ 
\\t\\n\\r]*\\}[ \\t\\n\\r]*$"];
-
+    
     // In the returned web page results live inside a <div class="doc"> tag.
     // Each of them is wrapped in a <pre> tag.
     // Find these, kill the potentially superfluous whitespace in there and 
create BibItems for each of them.
@@ -163,14 +161,13 @@
         return nil;
     }
     
-    NSMutableArray * results = nil;
+    NSMutableArray * results = [NSMutableArray array];
     
     for (NSXMLNode *node in preArray) {
         NSString * preContent = [node stringValue];
         NSString * cleanedRecord =     [preContent 
stringByCollapsingAndTrimmingCharactersInSet:[NSCharacterSet 
whitespaceAndNewlineCharacterSet]];
         cleanedRecord = [umlautFixer replaceWithString:@"{$1}" 
inString:cleanedRecord];
-        cleanedRecord = [lastCommaFixer replaceWithString:@"}}" 
inString:cleanedRecord];
-
+        
         NSError * parseError = nil;
         NSArray * newPubs = [BDSKBibTeXParser itemsFromString:cleanedRecord 
owner:owner error: &parseError];
         

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Bibdesk-commit mailing list
Bibdesk-commit@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bibdesk-commit

Reply via email to