poke-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] .info ios: Do not print the header when no IOS is open.


From: Egeyar Bagcioglu
Subject: [PATCH] .info ios: Do not print the header when no IOS is open.
Date: Tue, 12 May 2020 23:43:42 +0200

2020-05-12  Egeyar Bagcioglu  <address@hidden>

        * libpoke/libpoke.h: Fix comment.
        * poke/pk-ios.c (pk_cmd_info_ios): Do not print
        the header if there are no open IO spaces.
---
 libpoke/libpoke.h | 2 +-
 poke/pk-ios.c     | 9 +++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/libpoke/libpoke.h b/libpoke/libpoke.h
index b2b8157c..16a1b0dd 100644
--- a/libpoke/libpoke.h
+++ b/libpoke/libpoke.h
@@ -184,7 +184,7 @@ char *pk_ios_completion_function (pk_compiler pkc,
 
 const char *pk_ios_handler (pk_ios ios);
 
-/* Return the current IO space, or NULL if there are open spaces in
+/* Return the current IO space, or NULL if there are no open spaces in
    the given poke compiler.  */
 
 pk_ios pk_ios_cur (pk_compiler pkc);
diff --git a/poke/pk-ios.c b/poke/pk-ios.c
index ffc8fa2e..54b3a598 100644
--- a/poke/pk-ios.c
+++ b/poke/pk-ios.c
@@ -203,8 +203,13 @@ pk_cmd_info_ios (int argc, struct pk_cmd_arg argv[], 
uint64_t uflags)
 {
   assert (argc == 0);
 
-  pk_printf (_("  Id\tMode\tSize\t\tName\n"));
-  pk_ios_map (poke_compiler, print_info_ios, NULL);
+  if (pk_ios_cur(poke_compiler))
+    {
+      pk_printf (_("  Id\tMode\tSize\t\tName\n"));
+      pk_ios_map (poke_compiler, print_info_ios, NULL);
+    }
+  else
+    pk_printf (_("No IOS is currently open.\n"));
 
   return 1;
 }
-- 
2.25.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]