summaryrefslogtreecommitdiff
path: root/threadproc
diff options
context:
space:
mode:
authorbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2003-03-31 12:39:51 +0000
committerbjh <bjh@13f79535-47bb-0310-9956-ffa450edef68>2003-03-31 12:39:51 +0000
commit430251ee55dcf3bd6536ae77358c198e249271e7 (patch)
treef9e69379dd302e731c6e7cbfb30632f44499b8f6 /threadproc
parent3306377bc14e971ec30170a7b2135b46ff786466 (diff)
downloadlibapr-430251ee55dcf3bd6536ae77358c198e249271e7.tar.gz
OS/2: when parsing #! line, adjust for the fact that apr_file_gets() no
longer removes CR characters. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@64464 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'threadproc')
-rw-r--r--threadproc/os2/proc.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/threadproc/os2/proc.c b/threadproc/os2/proc.c
index b147ef285..0353000bd 100644
--- a/threadproc/os2/proc.c
+++ b/threadproc/os2/proc.c
@@ -380,8 +380,13 @@ APR_DECLARE(apr_status_t) apr_proc_create(apr_proc_t *proc, const char *progname
if (status == APR_SUCCESS) {
if (interpreter[0] == '#' && interpreter[1] == '!') {
- /* delete newline */
- interpreter[strlen(interpreter) - 1] = '\0';
+ /* delete CR/LF & any other whitespace off the end */
+ int end = strlen(interpreter) - 1;
+
+ while (end >= 0 && apr_isspace(interpreter[end])) {
+ interpreter[end] = '\0';
+ end--;
+ }
if (interpreter[2] != '/' && interpreter[2] != '\\' && interpreter[3] != ':') {
char buffer[300];