summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/standard/dl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/standard/dl.c b/ext/standard/dl.c
index 89f8aa0569..9cfccd5235 100644
--- a/ext/standard/dl.c
+++ b/ext/standard/dl.c
@@ -88,8 +88,10 @@ PHPAPI void *php_load_shlib(char *path, char **errp)
err = GET_DL_ERROR();
#ifdef PHP_WIN32
if (err && (*err)) {
+ size_t i = strlen(err);
(*errp)=estrdup(err);
LocalFree(err);
+ while (i > 0 && isspace((*errp)[i-1])) { (*errp)[i-1] = '\0'; i--; }
} else {
(*errp) = estrdup("<No message>");
}