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)
devs/discomfitor/cc
broggi_t 8 years ago committed by Boris Faure
parent 9814b10ad2
commit 2a397f35cd
  1. 1
      AUTHORS
  2. 3
      src/bin/about.c
  3. 5
      src/bin/tyalpha.c
  4. 5
      src/bin/tybg.c
  5. 25
      src/bin/tyls.c
  6. 5
      src/bin/typop.c
  7. 5
      src/bin/tyq.c

@ -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>

@ -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 "

@ -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;
}

@ -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;
}

@ -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)

@ -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;
}

@ -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;
}

Loading…
Cancel
Save