n
This commit is contained in:
parent
51dfa21bdf
commit
6ce76dc024
21
main.c
21
main.c
|
|
@ -25,6 +25,24 @@ markdown mdt;
|
||||||
|
|
||||||
FILE *fptr;
|
FILE *fptr;
|
||||||
|
|
||||||
|
char
|
||||||
|
*gantihuruf(const char *kata)
|
||||||
|
{
|
||||||
|
static char output[100];
|
||||||
|
char *dot = strrchr(kata, '.');
|
||||||
|
|
||||||
|
if (dot == NULL || dot == kata) {
|
||||||
|
snprintf(output, sizeof(output), "%s.html", kata);
|
||||||
|
} else {
|
||||||
|
int len = dot - kata;
|
||||||
|
strncpy(output, kata, len);
|
||||||
|
output[len] = '\0';
|
||||||
|
strcat(output, ".html");
|
||||||
|
}
|
||||||
|
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
checker()
|
checker()
|
||||||
{
|
{
|
||||||
|
|
@ -96,7 +114,8 @@ main(int argc, char *argv[])
|
||||||
file_name++;
|
file_name++;
|
||||||
}
|
}
|
||||||
|
|
||||||
snprintf(of, sizeof(of), "target/%s.html", file_name);
|
char *new_name = gantihuruf(file_name);
|
||||||
|
snprintf(of, sizeof(of), "target/%s", new_name);
|
||||||
|
|
||||||
fptr = fopen(argv[1], "rt");
|
fptr = fopen(argv[1], "rt");
|
||||||
if (fptr == NULL) {
|
if (fptr == NULL) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user