[rkward-cvs] SF.net SVN: rkward:[2866] trunk/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Tue May 18 08:12:00 UTC 2010


Revision: 2866
          http://rkward.svn.sourceforge.net/rkward/?rev=2866&view=rev
Author:   tfry
Date:     2010-05-18 08:12:00 +0000 (Tue, 18 May 2010)

Log Message:
-----------
In some cases container objects can have fewer elements than names(). Don't crash in this case.
See http://sourceforge.net/tracker/?func=detail&aid=3002439&group_id=50231&atid=459007

Modified Paths:
--------------
    trunk/rkward/ChangeLog
    trunk/rkward/rkward/rbackend/rkstructuregetter.cpp

Modified: trunk/rkward/ChangeLog
===================================================================
--- trunk/rkward/ChangeLog	2010-05-18 08:04:33 UTC (rev 2865)
+++ trunk/rkward/ChangeLog	2010-05-18 08:12:00 UTC (rev 2866)
@@ -1,5 +1,7 @@
 TODO: Do not use SmartInterface for KDE 4.5 and above
 
+- Fixed: Crash while analysing some objects returned by XML::xmlParseTree() for invalid XML
+- Fixed: Error while installing packages with R 2.11.0, when archiving packages in a non-existing directory
 - Add option to autosave script files (enabled by default)
 - The tabbar in the main window now shows a context menu with options to close/detach a window
 - The tabs in the main window can now be re-ordered by dragging with the mouse (left click if compiled with Qt 4.5 or above, middle click for earlier versions)

Modified: trunk/rkward/rkward/rbackend/rkstructuregetter.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rkstructuregetter.cpp	2010-05-18 08:04:33 UTC (rev 2865)
+++ trunk/rkward/rkward/rbackend/rkstructuregetter.cpp	2010-05-18 08:12:00 UTC (rev 2866)
@@ -2,7 +2,7 @@
                           rkstructuregetter  -  description
                              -------------------
     begin                : Wed Apr 11 2007
-    copyright            : (C) 2007, 2009 by Thomas Friedrichsmeier
+    copyright            : (C) 2007, 2009, 2010 by Thomas Friedrichsmeier
     email                : tfry at users.sourceforge.net
  ***************************************************************************/
 
@@ -417,8 +417,9 @@
 			}
 		} else if (do_cont) {
 			RK_DO (qDebug ("recurse into list %s", name.toLatin1().data ()), RBACKEND, DL_DEBUG);
-			// print.c in R has special handling for objects of this sort, so we better play it safe for those, too. It is not really certain that we need this, though (originally introduced in SVN rev 1826 without decent comment).
-			bool may_be_special = Rf_isObject (value) && (Rf_length (value) == 0);
+			// fewer elements than names() can happen, although I doubt it is supposed to happen.
+			// see http://sourceforge.net/tracker/?func=detail&aid=3002439&group_id=50231&atid=459007
+			bool may_be_special = Rf_length (value) < childcount;
 			if (Rf_isList (value) && (!may_be_special)) {		// old style list
 				for (unsigned int i = 0; i < childcount; ++i) {
 					SEXP child = CAR (value);


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




More information about the rkward-tracker mailing list