From 441b57d3f51f8c76e22ebd9d1f4bbecd48c08aaa Mon Sep 17 00:00:00 2001 From: Juan Jose Garcia Ripoll Date: Fri, 13 Apr 2012 01:02:38 +0200 Subject: [PATCH] Avoid calling ecl_char() in mkdir --- src/c/unixfsys.d | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/c/unixfsys.d b/src/c/unixfsys.d index 2d3e4a270..900288843 100755 --- a/src/c/unixfsys.d +++ b/src/c/unixfsys.d @@ -1027,8 +1027,11 @@ si_mkdir(cl_object directory, cl_object mode) /* Ensure a clean string, without trailing slashes, * and null terminated. */ cl_index last = filename->base_string.fillp; - while (last > 1 && IS_DIR_SEPARATOR(ecl_char(filename, --last))) - {} + if (last > 1) { + ecl_character c = filename->base_string.self[last-1]; + if (IS_DIR_SEPARATOR(c)) + last--; + } filename = ecl_subseq(filename, 0, last); } ecl_disable_interrupts();