Skip to content

Commit

Permalink
Issue fix for #70
Browse files Browse the repository at this point in the history
Prevent addition of '\' for files in the current folder on windows
  • Loading branch information
elgw committed Jun 22, 2024
1 parent bb1771d commit 9a3ea0a
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/dw.c
Original file line number Diff line number Diff line change
Expand Up @@ -941,12 +941,22 @@ void dw_argparsing(int argc, char ** argv, dw_opts * s)
char * bname = dw_basename(s->imFile);
s->outFile = malloc(strlen(dname) + strlen(bname) + strlen(s->prefix) + 10);
assert(s->outFile != NULL);
sprintf(s->outFile, "%s%c%s_%s", dname, FILESEP, s->prefix, bname);
if (strlen(dname) > 0)
{
sprintf(s->outFile, "%s%c%s_%s", dname, FILESEP, s->prefix, bname);
}
else {
sprintf(s->outFile, "%s_%s", s->prefix, bname);
}
s->outFolder = malloc(strlen(dname) + 16);
assert(s->outFolder != NULL);
sprintf(s->outFolder, "%s%c", dname, FILESEP);
free(bname);
free(dname);
if (s->verbosity > 1)
{
printf("outFile: %s\n", s->outFile);
}
} else {
char * dname = dw_dirname(s->outFile);
free(s->outFolder);
Expand Down Expand Up @@ -1980,6 +1990,14 @@ float * psf_makeOdd(float * psf, int64_t * pM, int64_t * pN, int64_t *pP)
void dcw_init_log(dw_opts * s)
{
s->log = fopen(s->logFile, "w");
if (s->log == NULL)
{
fprintf(stderr, "Unable to open %s for writing\n", s->logFile);
fprintf(stderr,
"Please check that you have permissions to write to the folder\n"
"and that the drive is not full\n");
exit(EXIT_FAILURE);
}
assert(s->log != NULL);
show_time(s->log);
dw_opts_fprint(s->log, s);
Expand Down Expand Up @@ -2072,6 +2090,8 @@ fftwf_complex * initial_guess(const int64_t M, const int64_t N, const int64_t P,
}
}
}
//printf("writing to one.tif");
//fim_tiff_write_float("one.tif", one, NULL, wM, wN, wP);
// writetif("one.tif", one, wM, wN, wP);

fftwf_complex * Fone = fft(one, wM, wN, wP);
Expand Down

0 comments on commit 9a3ea0a

Please sign in to comment.