Use an easier format string for the new snprintf wrapper
This commit was SVN r19894.
Этот коммит содержится в:
родитель
b5a30af20e
Коммит
5bbfeafea5
@ -5,7 +5,7 @@
|
|||||||
** Copyright (c) 1998-2008 **
|
** Copyright (c) 1998-2008 **
|
||||||
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
|
** Forschungszentrum Juelich, Juelich Supercomputing Centre **
|
||||||
** **
|
** **
|
||||||
** See the file COPYING in the package base directory for details **
|
** See the file COPYING in the package base directory for details **
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
@ -164,8 +164,12 @@ int main (int argc, char *argv[]) {
|
|||||||
out_filename = new char[strlen(infile)+5];
|
out_filename = new char[strlen(infile)+5];
|
||||||
char* dot = (char *) strrchr(infile, '.');
|
char* dot = (char *) strrchr(infile, '.');
|
||||||
if ( dot != 0 ) {
|
if ( dot != 0 ) {
|
||||||
vt_snprintf(out_filename, strlen(infile)+5, "%.*s.mod%s",
|
char* infile_prefix = new char[strlen(infile)];
|
||||||
(int)(dot - infile), infile, dot);
|
strncpy(infile_prefix, infile, (int)(dot - infile));
|
||||||
|
infile_prefix[(int)(dot-infile)] = '\0';
|
||||||
|
|
||||||
|
vt_snprintf(out_filename, strlen(infile)+5, "%s.mod%s",
|
||||||
|
infile_prefix, dot);
|
||||||
|
|
||||||
if ( keepSrcInfo && (lang & L_FORTRAN) ) {
|
if ( keepSrcInfo && (lang & L_FORTRAN) ) {
|
||||||
dot = strrchr(out_filename, '.');
|
dot = strrchr(out_filename, '.');
|
||||||
@ -177,6 +181,8 @@ int main (int argc, char *argv[]) {
|
|||||||
cerr << "ERROR: cannot open output file " << out_filename << "\n";
|
cerr << "ERROR: cannot open output file " << out_filename << "\n";
|
||||||
errFlag = true;
|
errFlag = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
delete [] infile_prefix;
|
||||||
} else {
|
} else {
|
||||||
cerr << "ERROR: cannot generate output file name\n";
|
cerr << "ERROR: cannot generate output file name\n";
|
||||||
errFlag =true;
|
errFlag =true;
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user