summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2016-10-22 12:48:54 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2016-10-22 12:48:54 +0200
commit328608b1fa67618b3d62109e4e50df1a5b58d4cf (patch)
tree9d218c9cddaad025cbf5193f7e5a18e7cea10eaf
parent269cb55ffe8f7d2ff96ece4a1ee1206fbf2f5775 (diff)
Replace removed gets function with readline to fix FTBFS
-rw-r--r--debian/changelog8
-rw-r--r--debian/patches/0135-replace_gets.patch71
-rw-r--r--debian/patches/series1
3 files changed, 80 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
index 537bd1a..97ab1ef 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+xbase64 (3.1.2-9) unstable; urgency=medium
+
+ * New debian/patches/0135-replace_gets.patch:
+ - Replace removed gets function with readline to fix FTBFS
+ (Closes: #841626).
+
+ -- Jörg Frings-Fürst <debian@jff-webhosting.net> Sat, 22 Oct 2016 12:47:33 +0200
+
xbase64 (3.1.2-8) unstable; urgency=medium
* Add symbols file for powerpcspe to fix FTBFS.
diff --git a/debian/patches/0135-replace_gets.patch b/debian/patches/0135-replace_gets.patch
new file mode 100644
index 0000000..36b990d
--- /dev/null
+++ b/debian/patches/0135-replace_gets.patch
@@ -0,0 +1,71 @@
+Description: Replace gets with readline
+Author: Jörg Frings-Fürst <debian@jff-webhosting.net>
+Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=841626
+Last-Update: 2016-10-22
+---
+This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
+Index: trunk/bin/dbfutil1.cpp
+===================================================================
+--- trunk.orig/bin/dbfutil1.cpp
++++ trunk/bin/dbfutil1.cpp
+@@ -38,6 +38,7 @@
+ */
+
+ #include <xbase64/xbase64.h>
++#include <limits>
+
+ // next lines are helpful for debugging purposes
+ /*
+@@ -153,11 +154,18 @@ void MyClass::FilterMenu()
+ /************************************************************************/
+ void MyClass::SetFilter()
+ {
+- char Expression[512];
+- memset( Expression, 0x00, 512 );
++ /* replace getc with getline */
++
++ constexpr int SIZE = 512;
++
++ char Expression[SIZE];
++ memset( Expression, 0x00, SIZE );
+ while( !strlen( Expression )){
+ std::cout << "Enter filter expression (like AMOUNT<5)" << std::endl;
+- gets( Expression );
++/* gets( Expression );*/
++ std::cin.getline(Expression, SIZE-1);
++ Expression[SIZE-1] = '\0';
++ std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
+ }
+ if( xbf )
+ delete xbf;
+@@ -235,19 +243,27 @@ void MyClass::LastFilterRec()
+ #ifdef XB_EXPRESSIONS
+ void MyClass::ProcessExpression()
+ {
+- char exprsn[256];
++ /* replace getc with getline */
++
++ constexpr int SIZE = 256;
++
++ char exprsn[SIZE];
+ char type;
+ xbExpn *exp; // expression
+ xbShort rc;
+ int debug = 0;
+- memset( exprsn, 0x00, 256 );
++ memset( exprsn, 0x00, SIZE );
+
+ std::cout << "Enter expression string or HELP" << std::endl;
+
+ while( !strstr( exprsn, "QUIT" ) && !strstr( exprsn, "quit" )){
+
+ std::cout << ">";
+- gets( exprsn );
++/* gets( exprsn ); */
++
++ std::cin.getline(exprsn, SIZE-1);
++ exprsn[SIZE-1] = '\0';
++ std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');
+
+ if( strstr( exprsn, "HELP" ) || strstr( exprsn, "help" )){
+ std::cout << "** Command Help ***" << std::endl << std::endl;
diff --git a/debian/patches/series b/debian/patches/series
index fd2b12c..a362949 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@
0110-c++-includes.diff
0115-gcc-fixes.diff
0120-fix-types-include.diff
+0135-replace_gets.patch