Commits

Vinay Sajip committed 5f08e17

Improved whitespace handling for customised commands.

Comments (0)

Files changed (3)

CLILauncher/launcher.c

 {
     wchar_t ** pp = builtin_prefixes;
     wchar_t * result = name;
+    wchar_t * p;
     size_t n;
 
-    for (; *pp; pp++) {
-        n = wcslen(*pp);
-        if (_wcsnicmp(*pp, name, n) == 0) {
+    for (; p = *pp; pp++) {
+        n = wcslen(p);
+        if (_wcsnicmp(p, name, n) == 0) {
             result += n;   /* skip the prefix */
+            if (p[n - 1] == L' ') /* No empty strings in table, so n > 1 */
+                result = skip_whitespace(result);
             break;
         }
     }
 import os
 import sys
 
-VERSION = 'Version=1.0.0.6'
+VERSION = 'Version=1.0.0.7'
 MANUFACTURER = 'Manufacturer=Vinay Sajip'
 X86 = 'Platform=x86'
 X64 = 'Platform=x64'
 
 VIRT_PATHS = [
     '/usr/bin/env ',
+    '/usr/bin/env  ', # test extra whitespace before command
     '/usr/bin/',
     '/usr/local/bin/',
     '',