[qgis] Patch QGIS bug #5809

Volker Fröhlich volter at fedoraproject.org
Wed Jul 18 20:55:19 UTC 2012


commit cf419dc326f0b797aaaa42c6b9cca032083112d2
Author: Volker Fröhlich <volker27 at gmx.at>
Date:   Wed Jul 18 22:54:22 2012 +0200

    Patch QGIS bug #5809

 qgis-1.8.0-datasource-crash.patch |   37 +++++++++++++++++++++++++++++++++++++
 qgis.spec                         |   10 +++++++++-
 2 files changed, 46 insertions(+), 1 deletions(-)
---
diff --git a/qgis-1.8.0-datasource-crash.patch b/qgis-1.8.0-datasource-crash.patch
new file mode 100644
index 0000000..0b5c475
--- /dev/null
+++ b/qgis-1.8.0-datasource-crash.patch
@@ -0,0 +1,37 @@
+commit 23a3412113a04fac0bdafffe9fc8a48c2a39e8ea
+Author: Juergen E. Fischer <jef at norbit.de>
+Date:   Wed Jun 20 21:01:25 2012 +0200
+
+    fix #5809
+
+diff --git a/src/providers/delimitedtext/qgsdelimitedtextprovider.cpp b/src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
+index 7b0bbb6..5b9837a 100644
+--- a/src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
++++ b/src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
+@@ -139,6 +139,8 @@ QgsDelimitedTextProvider::QgsDelimitedTextProvider( QString uri )
+     , mWktHasZM( false )
+     , mWktZMRegexp( "\\s+(?:z|m|zm)(?=\\s*\\()", Qt::CaseInsensitive )
+     , mWktCrdRegexp( "(\\-?\\d+(?:\\.\\d*)?\\s+\\-?\\d+(?:\\.\\d*)?)\\s[\\s\\d\\.\\-]+" )
++    , mFile( 0 )
++    , mStream( 0 )
+     , mSkipLines( 0 )
+     , mFirstDataLine( 0 )
+     , mShowInvalidLines( false )
+@@ -212,6 +214,7 @@ QgsDelimitedTextProvider::QgsDelimitedTextProvider( QString uri )
+   {
+     QgsDebugMsg( "Data source " + dataSourceUri() + " could not be opened" );
+     delete mFile;
++    mFile = 0;
+     return;
+   }
+ 
+@@ -447,7 +450,8 @@ QgsDelimitedTextProvider::QgsDelimitedTextProvider( QString uri )
+ 
+ QgsDelimitedTextProvider::~QgsDelimitedTextProvider()
+ {
+-  mFile->close();
++  if ( mFile )
++    mFile->close();
+   delete mFile;
+   delete mStream;
+ }
diff --git a/qgis.spec b/qgis.spec
index 05f271d..637d287 100644
--- a/qgis.spec
+++ b/qgis.spec
@@ -15,7 +15,7 @@
 
 Name:           qgis
 Version:        1.8.0
-Release:        5%{?dist}
+Release:        6%{?dist}
 Summary:        A user friendly Open Source Geographic Information System
 
 # Update FSF address or ship a GPLv3+ license file
@@ -41,6 +41,10 @@ Patch0: %{name}-1.5.0-grass.patch
 # Drop -o option from SIP, as versions older than 4.10 don't have it
 Patch1: %{name}-1.8.0-sip410.patch
 
+# http://hub.qgis.org/issues/5809
+# Crash when datasource is moved or deleted
+Patch2: %{name}-1.8.0-datasource-crash.patch
+
 # Leaving it to make life easier for ELGIS, as long as they target RHEL 5
 BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
@@ -147,6 +151,7 @@ Please refer to %{name}-mapserver-README.fedora for details!
 %setup -q
 %patch0 -p1 -b .grass~
 %patch1 -p1 -b .sip410~
+%patch2 -p1 -b .datasource~
 
 # Readme file for QGIS mapserver configuration and Lighttpd sample
 install -pm0644 %{SOURCE4} .
@@ -350,6 +355,9 @@ gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
 %{_libexecdir}/%{name}
 
 %changelog
+* Wed Jul 18 2012 Volker Fröhlich <volker27 at gmx.at> - 1.8.0-6
+- Add patch for QGIS bug #5809
+
 * Sat Jul  7 2012 Volker Fröhlich <volker27 at gmx.at> - 1.8.0-5
 - Rebuilt too quick
 


More information about the scm-commits mailing list