diff --git a/lib/modules/Process.pmod b/lib/modules/Process.pmod
index a5b010a5ebafc2252b8142473a1759aaca96be93..47e9692219db146681102a7e3a47c586fb1d5378 100644
--- a/lib/modules/Process.pmod
+++ b/lib/modules/Process.pmod
@@ -73,10 +73,18 @@ array(string) split_quoted_string(string s)
       case ' ':
       case '\t':
       case '\n':
-	while(strlen(x[e])==1 && e+1 < sizeof(x) &&
-	      (<' ','\t','\n'>) [x[e+1][0]])
-	  if(++e >= sizeof(x))
+	while(strlen(x[e])==1)
+	{
+	  if(e+1 < sizeof(x))
+	  {
+	    if((<' ','\t','\n'>) [x[e+1][0]])
+	      e++;
+	    else
+	      break;
+	  }else{
 	    return ret;
+	  }
+	}
 	ret+=({x[e][1..]});
       break;