From 72165b78d20a7504c2fac4358d6a5f1dc783be55 Mon Sep 17 00:00:00 2001
From: "Joachim Wuttke (laptop)" <j.wuttke@fz-juelich.de>
Date: Fri, 30 Apr 2010 15:14:42 +0200
Subject: [PATCH] corr, proper C++ ifstream usage

---
 pub/src/Makefile.am | 4 ++--
 pub/src/file_in.cpp | 8 +++++---
 pub/src/frida2.cpp  | 2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/pub/src/Makefile.am b/pub/src/Makefile.am
index 380677cd..bf5efe77 100644
--- a/pub/src/Makefile.am
+++ b/pub/src/Makefile.am
@@ -14,8 +14,8 @@ AM_CXXFLAGS = -g \
 	-Wsequence-point \
 	-Wstrict-aliasing -Wswitch \
         -Wunknown-pragmas \
-        -Wmissing-field-initializers \
-        -Wuninitialized
+        -Wmissing-field-initializers
+           # -Wuninitialized
            # -Wsign-compare -Wconversion
 
 # the following do not work on u1.spheres.frm2:
diff --git a/pub/src/file_in.cpp b/pub/src/file_in.cpp
index b10ca43d..f20b8927 100644
--- a/pub/src/file_in.cpp
+++ b/pub/src/file_in.cpp
@@ -45,9 +45,11 @@ void NFileIn::Load(void)
             mystd::fname_divide( vflong[i], &fdir, &fshort, &fext);
             
             if        ( fext=="y08" ) {
-                ifstream F_inpp (vflong[i].c_str(), ios_base::in);
-                Load_08( F_inpp, vflong[i] );
-            	F_inpp.close();
+                ifstream f (vflong[i].c_str(), ios_base::in);
+                if( f.fail() )
+                    throw "cannot open file " + vflong[i];
+                Load_08( f, vflong[i] );
+            	f.close();
             } else if ( fext=="a01" ) {
                 Load_01( F_in, vflong[i] );
             } else if ( fext=="i96" ) {
diff --git a/pub/src/frida2.cpp b/pub/src/frida2.cpp
index 9dd8884c..efc6dcde 100644
--- a/pub/src/frida2.cpp
+++ b/pub/src/frida2.cpp
@@ -107,7 +107,7 @@ int main()
                     "  x    execute shell command\n"
                     "  .    evaluate expression(s)\n"
                     "  _    special / temporary commands\n"
-                    "  /    meta commands and macros\n"
+                    "  \\?   help on meta commands and macros\n"
                     ;
 
             } else if (cmd == "c") {
-- 
GitLab