Keep the source clean of #ifdef where jtag_*_history() is actually used.

Signed-off-by: Márton Németh <[email protected]>
---
diff -upr urjtag-0.10.orig//src/jtag.c urjtag-0.10/src/jtag.c
--- urjtag-0.10.orig//src/jtag.c        2009-04-17 22:24:11.000000000 +0200
+++ urjtag-0.10/src/jtag.c      2011-12-04 11:10:59.795000000 +0100
@@ -143,8 +143,14 @@ jtag_save_history( void )

        free( file );
 }
-
+#else
+#define jtag_load_history()
+#define jtag_save_history()
 #endif /* HAVE_READLINE_HISTORY */
+
+#else
+#define jtag_load_history()
+#define jtag_save_history()
 #endif

 static int jtag_readline_multiple_commands_support(chain_t *chain, char * 
line) /* multiple commands should be separated with '::' */
@@ -470,18 +476,14 @@ main( int argc, char *const argv[] )

        if (go) {

-#ifdef HAVE_READLINE_HISTORY
                /* Load history */
                jtag_load_history();
-#endif

                /* main loop */
                jtag_readline_loop( chain, getenv("JTAG_PROMPT") ? : "jtag> " );

-#ifdef HAVE_READLINE_HISTORY
                /* Save history */
                jtag_save_history();
-#endif
        }

        cleanup( chain );

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure 
contains a definitive record of customers, application performance, 
security threats, fraudulent activity, and more. Splunk takes this 
data and makes sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-novd2d
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to