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:
parent
9814b10ad2
commit
2a397f35cd
1
AUTHORS
1
AUTHORS
|
@ -45,3 +45,4 @@ Nicholas Hughart <mekius@mekius.net>
|
||||||
Rafael Antognolli <antognolli@gmail.com>
|
Rafael Antognolli <antognolli@gmail.com>
|
||||||
Rui Seabra <rms@1407.org>
|
Rui Seabra <rms@1407.org>
|
||||||
Vincent Torri <vincent.torri@gmail.com>
|
Vincent Torri <vincent.torri@gmail.com>
|
||||||
|
Thibaut Broggi <broggi_t@epitech.eu>
|
||||||
|
|
|
@ -116,7 +116,8 @@ about_toggle(Evas_Object *win, Evas_Object *bg, Evas_Object *term,
|
||||||
"Nicholas Hughart<br>"
|
"Nicholas Hughart<br>"
|
||||||
"Rafael Antognolli<br>"
|
"Rafael Antognolli<br>"
|
||||||
"Rui Seabra<br>"
|
"Rui Seabra<br>"
|
||||||
"Vincent Torri<br>",
|
"Vincent Torri<br>"
|
||||||
|
"Thibaut Broggi<br>",
|
||||||
"All rights reserved.<br>"
|
"All rights reserved.<br>"
|
||||||
"<br>"
|
"<br>"
|
||||||
"Redistribution and use in source and binary forms, with or "
|
"Redistribution and use in source and binary forms, with or "
|
||||||
|
|
|
@ -33,10 +33,7 @@ main(int argc, char **argv)
|
||||||
snprintf(tbuf, sizeof(tbuf), "%c}ap%s", 0x1b, argv[i]);
|
snprintf(tbuf, sizeof(tbuf), "%c}ap%s", 0x1b, argv[i]);
|
||||||
else
|
else
|
||||||
snprintf(tbuf, sizeof(tbuf), "%c}at%s", 0x1b, argv[i]);
|
snprintf(tbuf, sizeof(tbuf), "%c}at%s", 0x1b, argv[i]);
|
||||||
if (write(0, tbuf, strlen(tbuf)) < 1) perror("write");
|
if (write(0, tbuf, strlen(tbuf) + 1) != (signed)(strlen(tbuf) + 1)) perror("write");
|
||||||
tbuf[0] = 0;
|
|
||||||
if (write(0, tbuf, 1) < 1) perror("write");
|
|
||||||
}
|
}
|
||||||
exit(0);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -35,10 +35,7 @@ main(int argc, char **argv)
|
||||||
snprintf(tbuf, sizeof(tbuf), "%c}bp%s", 0x1b, path);
|
snprintf(tbuf, sizeof(tbuf), "%c}bp%s", 0x1b, path);
|
||||||
else
|
else
|
||||||
snprintf(tbuf, sizeof(tbuf), "%c}bt%s", 0x1b, path);
|
snprintf(tbuf, sizeof(tbuf), "%c}bt%s", 0x1b, path);
|
||||||
if (write(0, tbuf, strlen(tbuf)) < 1) perror("write");
|
if (write(0, tbuf, strlen(tbuf) + 1) != (signed)(strlen(tbuf) + 1)) perror("write");
|
||||||
tbuf[0] = 0;
|
|
||||||
if (write(0, tbuf, 1) < 1) perror("write");
|
|
||||||
}
|
}
|
||||||
exit(0);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -789,25 +789,18 @@ main(int argc, char **argv)
|
||||||
for (i = 1; i < argc; i++)
|
for (i = 1; i < argc; i++)
|
||||||
{
|
{
|
||||||
char *path;
|
char *path;
|
||||||
|
char *cmp[] = {"-c", "-m", "-l"};
|
||||||
|
int j;
|
||||||
|
|
||||||
if (!strcmp(argv[i], "-c"))
|
for (j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
mode = SMALL;
|
if (!strcmp(argv[i], cmp[j]))
|
||||||
i++;
|
|
||||||
if (i >= argc) break;
|
|
||||||
}
|
|
||||||
else if (!strcmp(argv[i], "-m"))
|
|
||||||
{
|
{
|
||||||
mode = MEDIUM;
|
mode = j;
|
||||||
i++;
|
if (++i >= argc) break;
|
||||||
if (i >= argc) break;
|
|
||||||
}
|
}
|
||||||
else if (!strcmp(argv[i], "-l"))
|
|
||||||
{
|
|
||||||
mode = LARGE;
|
|
||||||
i++;
|
|
||||||
if (i >= argc) break;
|
|
||||||
}
|
}
|
||||||
|
if (i >= argc) break;
|
||||||
path = argv[i];
|
path = argv[i];
|
||||||
rp = ecore_file_realpath(path);
|
rp = ecore_file_realpath(path);
|
||||||
if (rp)
|
if (rp)
|
||||||
|
|
|
@ -25,10 +25,7 @@ main(int argc, char **argv)
|
||||||
path = argv[i];
|
path = argv[i];
|
||||||
if (realpath(path, buf)) path = buf;
|
if (realpath(path, buf)) path = buf;
|
||||||
snprintf(tbuf, sizeof(tbuf), "%c}pn%s", 0x1b, path);
|
snprintf(tbuf, sizeof(tbuf), "%c}pn%s", 0x1b, path);
|
||||||
if (write(0, tbuf, strlen(tbuf)) < 1) perror("write");
|
if (write(0, tbuf, strlen(tbuf) + 1) != (signed)(strlen(tbuf) + 1)) perror("write");
|
||||||
tbuf[0] = 0;
|
|
||||||
if (write(0, tbuf, 1) < 1) perror("write");
|
|
||||||
}
|
}
|
||||||
exit(0);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,10 +25,7 @@ main(int argc, char **argv)
|
||||||
path = argv[i];
|
path = argv[i];
|
||||||
if (realpath(path, buf)) path = buf;
|
if (realpath(path, buf)) path = buf;
|
||||||
snprintf(tbuf, sizeof(tbuf), "%c}pq%s", 0x1b, path);
|
snprintf(tbuf, sizeof(tbuf), "%c}pq%s", 0x1b, path);
|
||||||
if (write(0, tbuf, strlen(tbuf)) < 1) perror("write");
|
if (write(0, tbuf, strlen(tbuf) + 1) != (signed)(strlen(tbuf) + 1)) perror("write");
|
||||||
tbuf[0] = 0;
|
|
||||||
if (write(0, tbuf, 1) < 1) perror("write");
|
|
||||||
}
|
}
|
||||||
exit(0);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue