    Do not remove whitespace from file names when using "Open Selected"

    Previously, any spaces in a file name/path are elided. In a Windows
    environment, you often get paths with spaces included: this patch allows
    you to open files with such paths.

    This patch has been included as part of the following bug:

    http://sourceforge.net/tracker/index.php?func=detail&aid=1565125&group_id=11005&atid=111005
	    [ 1565125 ] No spaces in paths for "Open Selected"

diff -ur nedit_official nedit_mod
diff -ur nedit_official/source/selection.c nedit_mod/source/selection.c
--- nedit_official/source/selection.c	2004-08-01 12:06:11.000000000 +0200
+++ nedit_mod/source/selection.c	2006-08-21 13:40:38.264790800 +0200
@@ -285,12 +285,20 @@
     	strcpy(nameText, includeName);
     else if (sscanf(nameText, "#include <%[^<>]>", includeName) == 1)
     	sprintf(nameText, "%s%s", includeDir, includeName);
-    
-    /* strip whitespace from name */
-    for (inPtr=nameText, outPtr=nameText; *inPtr!='\0'; inPtr++)
-    	if (*inPtr != ' ' && *inPtr != '\t' && *inPtr != '\n')
-    	    *outPtr++ = *inPtr;
-    *outPtr = '\0';
+
+    /* strip whitespace from front and back of name, remove '\n's */
+    /* first skip leading whitespace */
+    for (inPtr = nameText; isspace(*inPtr); inPtr++)
+        continue;
+    /* then embedded '\n's */
+    for (outPtr = nameText; *inPtr != '\0'; inPtr++)
+        if (*inPtr != '\n')
+            *outPtr++ = *inPtr;
+    /* finally erase trailing whitespace */
+    do {
+        *outPtr = '\0';
+        --outPtr;
+    } while (outPtr >= nameText && isspace(*outPtr));
 
 #ifdef VMS
     /* If path name is relative, make it refer to current window's directory */
