[gjs] Kill a warning about uninitialized 'filename' (if argc == 0)



commit b2b5b7882931f70112ba25f8da38cfa8870ccfc7
Author: C. Scott Ananian <cscott litl com>
Date:   Wed Jun 3 17:49:42 2009 -0400

    Kill a warning about uninitialized 'filename' (if argc == 0)
    
    http://bugzilla.gnome.org/show_bug.cgi?id=584849
---
 gjs/console.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gjs/console.c b/gjs/console.c
index 2b21c4f..8572ab3 100644
--- a/gjs/console.c
+++ b/gjs/console.c
@@ -71,11 +71,11 @@ main(int argc, char **argv)
         exit(1);
     } 
 
-    if (argc == 1) {
+    if (argc <= 1) {
         script = g_strdup("const Console = imports.console; Console.interact();");
         len = strlen(script);
         filename = "<stdin>";
-    } else if (argc >= 2) {
+    } else /*if (argc >= 2)*/ {
         error = NULL;
         if (!g_file_get_contents(argv[1], &script, &len, &error)) {
             g_printerr("%s\n", error->message);



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