summaryrefslogtreecommitdiff
path: root/archivers/libcabinet/files/patch-listcab.cpp
diff options
context:
space:
mode:
authorTom Judge <tj@FreeBSD.org>2014-02-21 21:22:17 +0000
committerTom Judge <tj@FreeBSD.org>2014-02-21 21:22:17 +0000
commit782be382da9a4f2b54abce3e9eba23507d4eefef (patch)
treefce23d931957acd58d3e107efe1406db33400a74 /archivers/libcabinet/files/patch-listcab.cpp
parentUpdate to 4.45 and add stagedir support. (diff)
Fix install on HEAD and 10.0.
Notes
Notes: svn path=/head/; revision=345545
Diffstat (limited to 'archivers/libcabinet/files/patch-listcab.cpp')
-rw-r--r--archivers/libcabinet/files/patch-listcab.cpp64
1 files changed, 64 insertions, 0 deletions
diff --git a/archivers/libcabinet/files/patch-listcab.cpp b/archivers/libcabinet/files/patch-listcab.cpp
new file mode 100644
index 000000000000..b8c491785904
--- /dev/null
+++ b/archivers/libcabinet/files/patch-listcab.cpp
@@ -0,0 +1,64 @@
+--- listcab.cpp.orig 1999-10-24 08:11:38.000000000 -0400
++++ listcab.cpp 2014-02-21 16:14:29.246853465 -0500
+@@ -8,8 +8,8 @@
+ #include <stdio.h>
+ #include <string.h>
+ //#include <iomanip.h>
+-#include <fstream.h>
+-#include <iostream.h>
++#include <fstream>
++#include <iostream>
+ #include "cftypes.h"
+ #include "cfheader.h"
+ #include "cffolder.h"
+@@ -19,6 +19,10 @@
+ #include "cfreader.h"
+ #include "cfcreate.h"
+
++using std::endl;
++using std::cout;
++using std::cerr;
++
+ ////////////////////////////////////////****************************************
+
+ void display_header_info(cabinet_header& cfh);
+@@ -47,13 +51,19 @@
+ cerr << "New Folder Error: " << retval << endl;
+ return 1;
+ }
+-
++ int n;
+ do{
+ cout << "Enter filename: ";
+- gets(filename);
+-
+- if(strlen(filename) > 0)
++ fgets(filename, 256, stdin);
++ n = strlen (filename);
++
++ if (n == 1 && filename[0] == '\n')
++ n = 0;
++
++ if(n > 0)
+ {
++ if (filename[n-1] == '\n')
++ filename[n-1] = '\0';
+ if((retval = cab.add_file(filename)) != OK)
+ {
+ perror("read");
+@@ -62,10 +72,13 @@
+ return 1;
+ }
+ }
+- }while(strlen(filename) > 0);
++ }while(n > 0);
+
+ cout << "Enter filename for cabinet: ";
+- gets(filename);
++ fgets(filename, 256, stdin);
++ n = strlen (filename);
++ if (n > 0 && filename[n-1] == '\n')
++ filename[n-1] = '\0';
+
+ if((retval = cab.close(filename)) != OK)
+ {