From f657f349fca532ddf0c935e90b5452d3204404e1 Mon Sep 17 00:00:00 2001 From: Tomas Mlcoch Date: Wed, 29 Feb 2012 10:06:43 +0100 Subject: [PATCH] main cleanup --- main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 73bfd47..a214556 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -744,7 +745,7 @@ int main(int argc, char **argv) { g_queue_push_head(sub_dirs, input_dir_stripped); char *dirname; - while (dirname = g_queue_pop_head(sub_dirs)) { + while ((dirname = g_queue_pop_head(sub_dirs))) { // Open dir GDir *dirp; dirp = g_dir_open (dirname, 0, NULL); @@ -754,7 +755,7 @@ int main(int argc, char **argv) { } const gchar *filename; - while (filename = g_dir_read_name(dirp)) { + while ((filename = g_dir_read_name(dirp))) { gchar *full_path = g_strconcat(dirname, "/", filename, NULL); if (!g_file_test(full_path, G_FILE_TEST_IS_REGULAR)) { if (g_file_test(full_path, G_FILE_TEST_IS_DIR)) { @@ -813,7 +814,7 @@ int main(int argc, char **argv) { // Get index of last '/' int rel_path_len = strlen(relative_path); int x = rel_path_len; - for (x; x > 0; x--) { + for (; x > 0; x--) { if (relative_path[x] == '/') { break; } -- 2.7.4