diff --git a/Engine/sread.c b/Engine/sread.c index c5c9d631b28..376cb556dfb 100644 --- a/Engine/sread.c +++ b/Engine/sread.c @@ -236,6 +236,7 @@ static int undefine_score_macro(CSOUND *csound, const char *name) static inline int isNameChar(int c, int pos) { //c = (int) ((unsigned char) c); + if (c<0) return 0; return (isalpha(c) || (pos && (c == '_' || isdigit(c)))); } diff --git a/InOut/midifile.c b/InOut/midifile.c index e8c1010dc45..9b7b1d996dc 100644 --- a/InOut/midifile.c +++ b/InOut/midifile.c @@ -558,7 +558,7 @@ int csoundMIDIFileOpen(CSOUND *csound, const char *name) /* open file */ if (name == NULL || name[0] == '\0') return -1; - if (*name==3) name++; /* Because of ETX added bt readOptions */ + //if (*name==3) name++; /* Because of ETX added bt readOptions */ if (strcmp(name, "stdin") == 0) f = stdin; else { diff --git a/Top/argdecode.c b/Top/argdecode.c index 682364b9386..1811d0f10fc 100644 --- a/Top/argdecode.c +++ b/Top/argdecode.c @@ -524,6 +524,7 @@ static int decode_long(CSOUND *csound, char *s, int argc, char **argv) } else if (!(strncmp (s, "midifile=", 9))) { s += 9; + if (*s==3) s++; /* skip ETX */ if (UNLIKELY(*s == '\0')) dieu(csound, Str("no midifile name")); O->FMidiname = s; /* Midifile name */ if (!strcmp(O->FMidiname, "stdin")) { @@ -540,6 +541,7 @@ static int decode_long(CSOUND *csound, char *s, int argc, char **argv) } else if (!(strncmp (s, "midioutfile=", 12))) { s += 12; + if (*s==3) s++; /* skip ETX */ if (UNLIKELY(*s == '\0')) dieu(csound, Str("no midi output file name")); O->FMidioutname = s; return 1; @@ -568,6 +570,7 @@ static int decode_long(CSOUND *csound, char *s, int argc, char **argv) #ifdef EMBEDDED_PYTHON else if (strncmp(s, "pyvar=", 6) == 0) { s += 6; + if (*s==3) s++; /* skip ETX */ if (UNLIKELY(python_add_cmdline_definition(s))) dieu(csound, Str("invalid python variable definition syntax")); return 1; @@ -575,6 +578,7 @@ static int decode_long(CSOUND *csound, char *s, int argc, char **argv) #endif else if (!(strncmp (s, "input=", 6))) { s += 6; + if (*s==3) s++; /* skip ETX */ if (UNLIKELY(*s == '\0')) dieu(csound, Str("no infilename")); O->infilename = s; /* soundin name */ if (UNLIKELY(strcmp(O->infilename, "stdout") == 0)) @@ -637,6 +641,7 @@ static int decode_long(CSOUND *csound, char *s, int argc, char **argv) */ else if (!(strncmp (s, "score-in=", 9))) { s += 9; + if (*s==3) s++; /* skip ETX */ if (UNLIKELY(*s=='\0')) dieu(csound, Str("no Linein score device_name")); O->Linename = s; if (!strcmp(O->Linename, "stdin")) { @@ -737,6 +742,7 @@ static int decode_long(CSOUND *csound, char *s, int argc, char **argv) */ else if (!(strncmp (s, "midi-device=", 12))) { s += 12; + if (*s==3) s++; /* skip ETX */ if (UNLIKELY(*s=='\0')) dieu(csound, Str("no midi device_name")); O->Midiname = s; if (!strcmp(O->Midiname, "stdin")) { @@ -762,6 +768,7 @@ static int decode_long(CSOUND *csound, char *s, int argc, char **argv) } else if (!(strncmp (s, "output=", 7))) { s += 7; + if (*s==3) s++; /* skip ETX */ if (UNLIKELY(*s == '\0')) dieu(csound, Str("no outfilename")); O->outfilename = s; /* soundout name */ if (UNLIKELY(strcmp(O->outfilename, "stdin")) == 0) @@ -786,6 +793,7 @@ static int decode_long(CSOUND *csound, char *s, int argc, char **argv) /* -r N */ else if (!(strncmp (s, "sample-rate=", 12))) { s += 12; + if (*s==3) s++; /* skip ETX */ O->sr_override = (float)atof(s); return 1; } @@ -838,15 +846,16 @@ static int decode_long(CSOUND *csound, char *s, int argc, char **argv) else if (!(strncmp (s, "utility=", 8))) { int retval; s += 8; + if (*s==3) s++; /* skip ETX */ if (*s=='\0') dieu(csound, Str("no utility name")); retval = csoundRunUtility(csound, s, argc, argv); - if (retval) { - csound->info_message_request = 1; - csound->orchname = NULL; - return 0; - } - else csound->LongJmp(csound, retval); + if (retval) { + csound->info_message_request = 1; + csound->orchname = NULL; + return 0; + } + else csound->LongJmp(csound, retval); return 1; } /* -v */ @@ -922,6 +931,7 @@ static int decode_long(CSOUND *csound, char *s, int argc, char **argv) else if (!(strncmp (s, "opcode-lib=", 11))) { int nbytes; s += 11; + if (*s==3) s++; /* skip ETX */ nbytes = (int) strlen(s) + 1; if (csound->dl_opcodes_oplibs == NULL) { /* start new library list */