[snappy] snappy: change order of argc check
- From: Luis de Bethencourt <luisbg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [snappy] snappy: change order of argc check
- Date: Thu, 3 May 2012 15:08:27 +0000 (UTC)
commit 6fbf868ef8ca449c5d72c8cf3a950b1fe457d014
Author: Luis de Bethencourt <luis debethencourt com>
Date: Thu May 3 16:05:06 2012 +0100
snappy: change order of argc check
src/snappy.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/snappy.c b/src/snappy.c
index 6f02010..22bee76 100644
--- a/src/snappy.c
+++ b/src/snappy.c
@@ -132,16 +132,16 @@ process_args (int argc, char *argv[],
}
/* Check that at least one URI has been introduced */
- if (argc < 2) {
+ if (argc > 1) {
+ /* Save uris in the file glist */
+ for (index = 1; index < argc; index++) {
+ file_list = g_list_append (file_list, argv[index]);
+ g_debug ("Adding file: %s\n", argv[index]);
+ pos++;
+ }
+ } else {
+ /* If no files passed by user display help */
g_print ("%s", g_option_context_get_help (context, TRUE, NULL));
- return NULL;
- }
-
- /* Save uris in the file glist */
- for (index = 1; index < argc; index++) {
- file_list = g_list_append (file_list, argv[index]);
- g_debug ("Adding file: %s\n", argv[index]);
- pos++;
}
return file_list;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]