Skip to content
Snippets Groups Projects
Commit e9a94a29 authored by Dirk Zimoch's avatar Dirk Zimoch
Browse files

remove all whitespace at end of line, including CR and NL

parent f27d19c9
No related branches found
No related tags found
No related merge requests found
......@@ -267,7 +267,7 @@ int runScript(const char* filename, const char* args)
if ((line_raw = realloc(line_raw, line_raw_size *= 2)) == NULL) goto error;
if (fgets(line_raw + len, line_raw_size - len, file) == NULL) break;
}
if (line_raw[len-1] == '\n') line_raw[--len] = 0; /* get rid of '\n' */
while (len > 0 && isspace((unsigned char)line_raw[len-1])) line_raw[--len] = 0; /* get rid of '\n' and friends */
if (runScriptDebug)
printf("runScript raw line (%ld chars): '%s'\n", len, line_raw);
/* expand and check the buffer size (different epics versions write different may number of bytes)*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment