mail[Wesnoth-commits] r52560 - /trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/views/AddonsView.java


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by timotei_cluj on January 11, 2012 - 21:02:
Author: timotei
Date: Wed Jan 11 21:02:25 2012
New Revision: 52560

URL: http://svn.gna.org/viewcvs/wesnoth?rev=52560&view=rev
Log:
eclipse plugin: fix the parsing of the addon's info if the output is malformed

Modified:
    trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/views/AddonsView.java

Modified: 
trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/views/AddonsView.java
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/views/AddonsView.java?rev=52560&r1=52559&r2=52560&view=diff
==============================================================================
--- trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/views/AddonsView.java 
(original)
+++ trunk/utils/umc_dev/org.wesnoth/src/org/wesnoth/views/AddonsView.java Wed 
Jan 11 21:02:25 2012
@@ -370,9 +370,16 @@
 
                         // got something interesting? parse it
                         if( tmpColumns != null && index != - 1 ) {
+                            int firstIndex = line.indexOf( '\'' ) + 1;
+                            int lastIndex = line.lastIndexOf( '\'' );
+
+                            if( lastIndex < firstIndex ) {
+                                lastIndex = line.length( );
+                            }
+
                             tmpColumns[index] = line.substring(
-                                line.indexOf( '\'' ) + 1,
-                                line.lastIndexOf( '\'' ) ).trim( );
+                                firstIndex,
+                                lastIndex ).trim( );
                         }
                     }
 




Related Messages


Powered by MHonArc, Updated Wed Jan 11 23:00:07 2012