/* can be NULL while c1mode or linking without compiling */
char *fullDstFileName; /* full name for the output file; */
/* only given by -o, otherwise NULL */
-size_t fullDstFileNameLen; /* size of previous string. */
char *dstFileName; /* destination file name without extension */
char *dstPath = ""; /* path for the output files; */
/* "" is equivalent with cwd */
static char *
getStringArg(const char *szStart, char **argv, int *pi, int argc)
{
- if (argv[*pi][strlen(szStart)])
+ if (argv[*pi][strlen(szStart)])
{
return &argv[*pi][strlen(szStart)];
}
- else
+ else
{
++(*pi);
- if (*pi >= argc)
+ if (*pi >= argc)
{
werror (E_ARGUMENT_MISSING, szStart);
/* Die here rather than checking for errors later. */
exit(-1);
}
- else
+ else
{
return argv[*pi];
}
}
/** Gets the integer argument to this option using the same rules as
- getStringArg.
+ getStringArg.
*/
static int
getIntArg(const char *szStart, char **argv, int *pi, int argc)
else
{
fullDstFileName = Safe_strdup (buffer);
- fullDstFileNameLen = strlen(fullDstFileName) + 1;
/* get rid of the "."-extension */
/* if debug option is set then open the cdbFile */
if (options.debug && fullSrcFileName)
{
- SNPRINTF (scratchFileName, sizeof(scratchFileName),
+ SNPRINTF (scratchFileName, sizeof(scratchFileName),
"%s.adb", dstFileName); //JCF: Nov 30, 2002
if(debugFile->openFile(scratchFileName))
debugFile->writeModule(moduleName);
int i, system_ret;
/* first we need to create the <filename>.lnk file */
- SNPRINTF (scratchFileName, sizeof(scratchFileName),
+ SNPRINTF (scratchFileName, sizeof(scratchFileName),
"%s.lnk", dstFileName);
if (!(lnkfile = fopen (scratchFileName, "w")))
{
"Add support for your FLAT24 target in %s @ line %d\n",
__FILE__, __LINE__);
exit(-1);
- }
+ }
}
#endif
else
{
strncpyz (scratchFileName, relFiles[0], sizeof(scratchFileName));
- /* strip "rel" extension */
+ /* strip ".rel" extension */
p = strrchr (scratchFileName, '.');
if (p)
{
- p++;
- *p = 0;
+ *p = 0;
}
-
}
strncatz (scratchFileName,
- options.out_fmt ? "S19" : "ihx",
+ options.out_fmt ? ".S19" : ".ihx",
sizeof(scratchFileName));
rename (scratchFileName, fullDstFileName);
- q = strrchr (fullDstFileName, '.');
- if (q)
- {
- /* point after the '.' of the extension */
- q++;
- }
- else
+ strncpyz (buffer, fullDstFileName, sizeof(buffer));
+ q = strrchr (buffer, '.');
+ if (!q)
{
/* no extension: append new extensions */
- /* Don't we want to append a period here ? */
- q = strlen (fullDstFileName) + fullDstFileName;
+ q = strlen (buffer) + buffer;
}
-
- *p = 0;
- strncatz (scratchFileName, "map", sizeof(scratchFileName));
+
+ *p = 0;
+ strncatz (scratchFileName, ".map", sizeof(scratchFileName));
*q = 0;
- strncatz(fullDstFileName, "map", fullDstFileNameLen);
- rename (scratchFileName, fullDstFileName);
- *p = 0;
- strncatz (scratchFileName, "mem", sizeof(scratchFileName));
+ strncatz(buffer, ".map", sizeof(buffer));
+ rename (scratchFileName, buffer);
+ *p = 0;
+ strncatz (scratchFileName, ".mem", sizeof(scratchFileName));
*q = 0;
- strncatz(fullDstFileName, "mem", fullDstFileNameLen);
- rename (scratchFileName, fullDstFileName);
+ strncatz(buffer, ".mem", sizeof(buffer));
+ rename (scratchFileName, buffer);
}
if (system_ret)
{