Added -s functionality

This commit is contained in:
phixxy 2026-03-21 13:36:35 -07:00
parent 7989f0d9ca
commit 16f21b4a9a

View file

@ -35,10 +35,13 @@ int make_skratch_file(struct Flags *f)
{ {
char fp[4096]; char fp[4096];
int fd = 0; int fd = 0;
snprintf(fp, sizeof(fp), "%s/%s", f->skratch_path, f->filename); if (!f->use_s) f->suffix = "";
snprintf(fp, sizeof(fp), "%s/%s%s", f->skratch_path, f->filename, f->suffix);
if (!strcmp(f->filename, "skratch-XXXXXX")) if (!strcmp(f->filename, "skratch-XXXXXX"))
{ {
fd = mkstemp(fp); int s_len = strlen(f->suffix);
fd = mkstemps(fp, s_len);
close(fd); close(fd);
} }
if (fd == -1) if (fd == -1)