From: Andrew M. <fit...@us...> - 2006-02-24 21:50:50
|
Update of /cvsroot/radmind/radmind-assistant/rte In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13271 Modified Files: RXTranscript-ConversionAdditions.m Log Message: [Bug 1384361] - fix for bug in base path conversion. Index: RXTranscript-ConversionAdditions.m =================================================================== RCS file: /cvsroot/radmind/radmind-assistant/rte/RXTranscript-ConversionAdditions.m,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** RXTranscript-ConversionAdditions.m 30 Oct 2003 18:13:44 -0000 1.1 --- RXTranscript-ConversionAdditions.m 24 Feb 2006 21:50:47 -0000 1.2 *************** *** 11,14 **** --- 11,15 ---- - ( int )convertTranscriptBaseToPath: ( NSString * )basepath { + NSAutoreleasePool *pool; NSMutableArray *transcriptLines = [[ self transcriptContents ] mutableCopy ]; NSString *path = nil, *currentbase = nil; *************** *** 35,38 **** --- 36,40 ---- } + pool = [[ NSAutoreleasePool alloc ] init ]; for ( ; i < [ transcriptLines count ]; i++ ) { path = [[ transcriptLines objectAtIndex: i ] objectForKey: @"path" ]; *************** *** 48,51 **** --- 50,65 ---- [[ transcriptLines objectAtIndex: i ] setObject: path forKey: @"path" ]; + + if ( [[[ transcriptLines objectAtIndex: i ] + objectForKey: @"type" ] isEqualToString: @"h" ] ) { + path = [[ transcriptLines objectAtIndex: i ] objectForKey: @"dest" ]; + if ( path != nil && + [[ path substringToIndex: 2 ] isEqualToString: @"./" ] ) { + path = [ path substringFromIndex: 1 ]; + [[ transcriptLines objectAtIndex: i ] setObject: path + forKey: @"dest" ]; + } + } + continue; } *************** *** 58,65 **** --- 72,93 ---- [[ transcriptLines objectAtIndex: i ] setObject: path forKey: @"path" ]; + + if ( [[[ transcriptLines objectAtIndex: i ] + objectForKey: @"type" ] isEqualToString: @"h" ] ) { + path = [[ transcriptLines objectAtIndex: i ] objectForKey: @"dest" ]; + if ( path != nil && + [[ path substringToIndex: 1 ] isEqualToString: @"/" ] ) { + path = [ NSString stringWithFormat: @"%@%@", + [ basepath substringToIndex: 1 ], path ]; + [[ transcriptLines objectAtIndex: i ] setObject: path + forKey: @"dest" ]; + } + } } } + [ pool release ]; [ self setTranscriptContents: transcriptLines ]; + [ transcriptLines autorelease ]; return( 1 ); |