mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
73fdbba59c
This was a workaround to be able to build on case-insensitive file systems where it might get confused about <string.h> vs <String.h>. Let's just not support building that way, so String.h can have an objectively nicer name. :^)
28 lines
489 B
C++
28 lines
489 B
C++
#include <AK/String.h>
|
|
#include <AK/QuickSort.h>
|
|
#include <AK/Vector.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int main(int argc, char** argv)
|
|
{
|
|
if (argc != 3) {
|
|
printf("usage: tr <from> <to>");
|
|
return 0;
|
|
}
|
|
|
|
char from = argv[1][0];
|
|
char to = argv[2][0];
|
|
|
|
for (;;) {
|
|
char ch = fgetc(stdin);
|
|
if (feof(stdin))
|
|
break;
|
|
if (ch == from)
|
|
putchar(to);
|
|
else
|
|
putchar(ch);
|
|
}
|
|
|
|
return 0;
|
|
}
|