Inital commit for simple tools repo
This commit is contained in:
commit
8f862e91e0
7 changed files with 285 additions and 0 deletions
22
removenl
Executable file
22
removenl
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/usr/bin/tcc -run
|
||||
/* vim: set syn=c: */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
|
||||
/*
|
||||
* 0x0a - linefeed
|
||||
* 0x0d - carriage return
|
||||
**/
|
||||
|
||||
int
|
||||
main() {
|
||||
char buffer;
|
||||
size_t nread;
|
||||
|
||||
while ((nread = fread(&buffer, 1, sizeof buffer, stdin)) > 0)
|
||||
if (buffer != 0x0a && buffer != 0x0d)
|
||||
fwrite(&buffer, 1, nread, stdout);
|
||||
|
||||
return 0;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue