summaryrefslogtreecommitdiff
path: root/src/bin/tyls.c
diff options
context:
space:
mode:
authorbroggi_t <broggi_t@epitech.eu>2015-02-04 05:57:21 +0100
committerBoris Faure <billiob@gmail.com>2015-02-07 12:02:19 +0100
commit2a397f35cdc2e781ce4fe26cc1b6476fbfb8a8d9 (patch)
treed35e1001cc14c21e8518650e701acb850673f419 /src/bin/tyls.c
parent9814b10ad2f2d6ee4371bbf25d41ff178505624d (diff)
fix some possible bug in tyalpha, tybg, typop, tyq commands
make the code prettier in tyls remove useless exit(0) at the end of the main (just before some return 0)
Diffstat (limited to 'src/bin/tyls.c')
-rw-r--r--src/bin/tyls.c25
1 files changed, 9 insertions, 16 deletions
diff --git a/src/bin/tyls.c b/src/bin/tyls.c
index c8067c7..12975ce 100644
--- a/src/bin/tyls.c
+++ b/src/bin/tyls.c
@@ -789,25 +789,18 @@ main(int argc, char **argv)
789 for (i = 1; i < argc; i++) 789 for (i = 1; i < argc; i++)
790 { 790 {
791 char *path; 791 char *path;
792 char *cmp[] = {"-c", "-m", "-l"};
793 int j;
792 794
793 if (!strcmp(argv[i], "-c")) 795 for (j = 0; j < 3; j++)
794 { 796 {
795 mode = SMALL; 797 if (!strcmp(argv[i], cmp[j]))
796 i++; 798 {
797 if (i >= argc) break; 799 mode = j;
798 } 800 if (++i >= argc) break;
799 else if (!strcmp(argv[i], "-m")) 801 }
800 {
801 mode = MEDIUM;
802 i++;
803 if (i >= argc) break;
804 }
805 else if (!strcmp(argv[i], "-l"))
806 {
807 mode = LARGE;
808 i++;
809 if (i >= argc) break;
810 } 802 }
803 if (i >= argc) break;
811 path = argv[i]; 804 path = argv[i];
812 rp = ecore_file_realpath(path); 805 rp = ecore_file_realpath(path);
813 if (rp) 806 if (rp)