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)
This commit is contained in:
broggi_t 2015-02-04 05:57:21 +01:00 committed by Boris Faure
parent 9814b10ad2
commit 2a397f35cd
7 changed files with 16 additions and 33 deletions

View File

@ -45,3 +45,4 @@ Nicholas Hughart <mekius@mekius.net>
Rafael Antognolli <antognolli@gmail.com>
Rui Seabra <rms@1407.org>
Vincent Torri <vincent.torri@gmail.com>
Thibaut Broggi <broggi_t@epitech.eu>

View File

@ -116,7 +116,8 @@ about_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
"Nicholas Hughart<br>"
"Rafael Antognolli<br>"
"Rui Seabra<br>"
"Vincent Torri<br>",
"Vincent Torri<br>"
"Thibaut Broggi<br>",
"All rights reserved.<br>"
"<br>"
"Redistribution and use in source and binary forms, with or "

View File

@ -33,10 +33,7 @@ main(int argc, char **argv)
snprintf(tbuf, sizeof(tbuf), "%c}ap%s", 0x1b, argv[i]);
else
snprintf(tbuf, sizeof(tbuf), "%c}at%s", 0x1b, argv[i]);
if (write(0, tbuf, strlen(tbuf)) < 1) perror("write");
tbuf[0] = 0;
if (write(0, tbuf, 1) < 1) perror("write");
if (write(0, tbuf, strlen(tbuf) + 1) != (signed)(strlen(tbuf) + 1)) perror("write");
}
exit(0);
return 0;
}

View File

@ -35,10 +35,7 @@ main(int argc, char **argv)
snprintf(tbuf, sizeof(tbuf), "%c}bp%s", 0x1b, path);
else
snprintf(tbuf, sizeof(tbuf), "%c}bt%s", 0x1b, path);
if (write(0, tbuf, strlen(tbuf)) < 1) perror("write");
tbuf[0] = 0;
if (write(0, tbuf, 1) < 1) perror("write");
if (write(0, tbuf, strlen(tbuf) + 1) != (signed)(strlen(tbuf) + 1)) perror("write");
}
exit(0);
return 0;
}

View File

@ -789,25 +789,18 @@ main(int argc, char **argv)
for (i = 1; i < argc; i++)
{
char *path;
char *cmp[] = {"-c", "-m", "-l"};
int j;
if (!strcmp(argv[i], "-c"))
for (j = 0; j < 3; j++)
{
mode = SMALL;
i++;
if (i >= argc) break;
}
else if (!strcmp(argv[i], "-m"))
{
mode = MEDIUM;
i++;
if (i >= argc) break;
}
else if (!strcmp(argv[i], "-l"))
{
mode = LARGE;
i++;
if (i >= argc) break;
if (!strcmp(argv[i], cmp[j]))
{
mode = j;
if (++i >= argc) break;
}
}
if (i >= argc) break;
path = argv[i];
rp = ecore_file_realpath(path);
if (rp)

View File

@ -25,10 +25,7 @@ main(int argc, char **argv)
path = argv[i];
if (realpath(path, buf)) path = buf;
snprintf(tbuf, sizeof(tbuf), "%c}pn%s", 0x1b, path);
if (write(0, tbuf, strlen(tbuf)) < 1) perror("write");
tbuf[0] = 0;
if (write(0, tbuf, 1) < 1) perror("write");
if (write(0, tbuf, strlen(tbuf) + 1) != (signed)(strlen(tbuf) + 1)) perror("write");
}
exit(0);
return 0;
}

View File

@ -25,10 +25,7 @@ main(int argc, char **argv)
path = argv[i];
if (realpath(path, buf)) path = buf;
snprintf(tbuf, sizeof(tbuf), "%c}pq%s", 0x1b, path);
if (write(0, tbuf, strlen(tbuf)) < 1) perror("write");
tbuf[0] = 0;
if (write(0, tbuf, 1) < 1) perror("write");
if (write(0, tbuf, strlen(tbuf) + 1) != (signed)(strlen(tbuf) + 1)) perror("write");
}
exit(0);
return 0;
}