if (p < &str[PATH_MAX-1])
*p++ = c;
c = get();
- } while (c && ((ctype[c] != SPACE)||(c == ':')||(c == '\\')));
- while (p < &str[PATH_MAX])
- *p++ = 0;
+ } while (c);
+ /* trim trailing spaces */
+ while (ctype[*(--p)] == SPACE)
+ ;
+ /* terminate the string */
+ *(++p) = '\0';
}
/*)Function char getnb()
MUST be terminated with a NULL.
*/
static const char *_linkCmd[] = {
- "linkavr", "", "$1", NULL
+ "linkavr", "", "\"$1\"", NULL
};
/* $3 is replaced by assembler.debug_opts resp. port->assembler.plain_opts */
static const char *_asmCmd[] = {
- "asavr", "$l" , "$3", "$1.s", NULL
+ "asavr", "$l" , "$3", "\"$1.s\"", NULL
};
/* Globals */
*/
static const char *_linkCmd[] =
{
- "aslink", "-nf", "$1", NULL
+ "aslink", "-nf", "\"$1\"", NULL
};
/* $3 is replaced by assembler.debug_opts resp. port->assembler.plain_opts */ static const char *_asmCmd[] =
{
- "asx8051", "$l", "$3", "$1.asm", NULL
+ "asx8051", "$l", "$3", "\"$1.asm\"", NULL
};
/* Globals */
*/
static const char *_linkCmd[] =
{
- "aslink", "-nf", "$1", NULL
+ "aslink", "-nf", "\"$1\"", NULL
};
/* $3 is replaced by assembler.debug_opts resp. port->assembler.plain_opts */
static const char *_asmCmd[] =
{
- "asx8051", "$l", "$3", "$1.asm", NULL
+ "asx8051", "$l", "$3", "\"$1.asm\"", NULL
};
/* Globals */
*/
static const char *_asmCmd[] =
{
- "gpasm", "-c -I /usr/local/share/gpasm/header -o $2", "$1.asm", NULL
-
+ /* This should be:
+ * "gpasm", "-c -I \"{datadir}\" -o \"$2\"", "\"$1.asm\"", NULL
+ * but unfortunately buildCmdLine() doesn't expand {xxx} macros.
+ */
+ "gpasm", "-c -I \"/usr/local/share/gpasm/header\" -o \"$2\"", "\"$1.asm\"", NULL
};
/* Globals */
};
extern int rewinds;
-void _xa51_genAssemblerEnd () {
+void _xa51_genAssemblerEnd (FILE * of)
+{
//fprintf (stderr, "Did %d rewind%c for c-line in asm comments\n", rewinds,
//rewinds==1 ? '\0' : 's');
}
*/
static const char *_linkCmd[] =
{
- "xa_link", "", "$1", NULL
+ "xa_link", "", "\"$1\"", NULL
};
/* $3 is replaced by assembler.debug_opts resp. port->assembler.plain_opts */
static const char *_asmCmd[] =
{
- "xa_rasm", "$l", "$3", "$1.asm", NULL
+ "xa_rasm", "$l", "$3", "\"$1.asm\"", NULL
};
/* Globals */
static const char *_gbz80_rgbasmCmd[] =
{
- "rgbasm", "-o$1.o", "$1.asm", NULL
+ "rgbasm", "-o\"$1.o\"", "\"$1.asm\"", NULL
};
static const char *_gbz80_rgblinkCmd[] =
{
- "xlink", "-tg", "-n$1.sym", "-m$1.map", "-zFF", "$1.lnk", NULL
+ "xlink", "-tg", "-n\"$1.sym\"", "-m\"$1.map\"", "-zFF", "\"$1.lnk\"", NULL
};
static void
{
if (options.nostdlib == FALSE)
{
- setMainValue ("z80libspec", "-k{libdir}{sep}{port} -l{port}.lib");
- setMainValue ("z80crt0", "{libdir}{sep}{port}{sep}crt0{objext}");
+ setMainValue ("z80libspec", "-k\"{libdir}{sep}{port}\" -l\"{port}.lib\"");
+ setMainValue ("z80crt0", "\"{libdir}{sep}{port}{sep}crt0{objext}\"");
}
else
{
"link-{port} -n -c -- {z80bases} -m -j" \
" {z80libspec}" \
" {z80extralibfiles} {z80extralibpaths}" \
- " {z80outputtypeflag} {linkdstfilename}" \
+ " {z80outputtypeflag} \"{linkdstfilename}\"" \
" {z80crt0}" \
- " {dstfilename}{objext}" \
+ " \"{dstfilename}{objext}\"" \
" {z80extraobj}"
#define ASMCMD \
- "as-{port} -plosgff {objdstfilename} {dstfilename}{asmext}"
+ "as-{port} -plosgff \"{objdstfilename}\" \"{dstfilename}{asmext}\""
/* Globals */
PORT z80_port =