From kde-commits Sun May 31 22:00:51 2009 From: Alexander Rieder Date: Sun, 31 May 2009 22:00:51 +0000 To: kde-commits Subject: playground/edu/mathematik/src/backends/sage Message-Id: <1243807251.810931.10039.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=124386172727503 SVN commit 976103 by arieder: fix sage backend sometimes not showing plots, because it detects the tmp directory wrong M +5 -1 sagesession.cpp --- trunk/playground/edu/mathematik/src/backends/sage/sagesession.cpp #976102:976103 @@ -121,7 +121,11 @@ { kDebug()<<"received tmp dir information"; int index=out.indexOf("___TMP_DIR___" )+14; - m_tmpPath=out.mid( index, index-out.indexOf('\n',index ) ).trimmed(); + int endIndex=out.indexOf("\n", index); + if(endIndex==-1) + m_tmpPath=out.mid( index ).trimmed(); + else + m_tmpPath=out.mid( index, index-out.indexOf("\n",index) ).trimmed(); kDebug()<<"tmp path: "<