diff options
author | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2001-04-05 21:05:55 +0000 |
---|---|---|
committer | tradke <tradke@b589c3ab-70e8-4b4d-a09f-cba2dd200880> | 2001-04-05 21:05:55 +0000 |
commit | 89fb0b58d9d103db11b7e18286dccd9825fd7754 (patch) | |
tree | 9f7f1ecbc3036dce22206898b7df15a9ea77e9c5 /src/WriteGF.c | |
parent | 55e80b4dc1af49f96e59f085f9c00d134d708a52 (diff) |
Omit the dotslash in advertised output filenames if output goes into
current directory.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusBase/IOBasic/trunk@87 b589c3ab-70e8-4b4d-a09f-cba2dd200880
Diffstat (limited to 'src/WriteGF.c')
-rw-r--r-- | src/WriteGF.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/WriteGF.c b/src/WriteGF.c index d5c7d18..71f7b05 100644 --- a/src/WriteGF.c +++ b/src/WriteGF.c @@ -168,8 +168,16 @@ void IOBasic_WriteGF (cGH *GH, /* build the filename */ if (new_filename_scheme) { - sprintf (filename, "%s/%s_%s%s", myGH->outdirScalar, alias, - reduction_op, file_extension); + /* skip the pathname if output goes into current directory */ + if (strcmp (myGH->outdirScalar, ".")) + { + sprintf (filename, "%s/%s_%s%s", myGH->outdirScalar, alias, + reduction_op, file_extension); + } + else + { + sprintf (filename, "%s_%s%s", alias, reduction_op, file_extension); + } } else { @@ -194,8 +202,16 @@ void IOBasic_WriteGF (cGH *GH, { file_extension = "unknown"; } - sprintf (filename, "%s/%s_%s.tl", myGH->outdirScalar, alias, - file_extension); + /* skip the pathname if output goes into current directory */ + if (strcmp (myGH->outdirScalar, ".")) + { + sprintf (filename, "%s/%s_%s.tl", myGH->outdirScalar, alias, + file_extension); + } + else + { + sprintf (filename, "%s_%s.tl", alias, file_extension); + } } /* see if output files for this alias name were already created */ |