fixes to handle URL and files the same way. Reference: /n/sources/patch/saved/dt.showfile Date: Wed May 24 18:36:50 CES 2006 Signed-off-by: fst@9netics.com --- /sys/src/cmd/unix/drawterm/include/9windows.h Wed May 24 18:34:38 2006 +++ /sys/src/cmd/unix/drawterm/include/9windows.h Wed May 24 18:34:35 2006 @@ -18,3 +18,4 @@ typedef __int64 p9_vlong; typedef unsigned __int64 p9_uvlong; +typedef uintptr_t uintptr; --- /sys/src/cmd/unix/drawterm/include/lib.h Wed May 24 18:34:51 2006 +++ /sys/src/cmd/unix/drawterm/include/lib.h Wed May 24 18:34:48 2006 @@ -223,6 +223,9 @@ extern Rune* runesmprint(char*, ...); extern Rune* runevsmprint(char*, va_list); +extern long runestrlen(Rune*); +extern Rune* runestrchr(Rune*, Rune); + extern int fmtfdinit(Fmt*, int, char*, int); extern int fmtfdflush(Fmt*); extern int fmtstrinit(Fmt*); --- /sys/src/cmd/unix/drawterm/kern/win32.c Wed May 24 18:35:08 2006 +++ /sys/src/cmd/unix/drawterm/kern/win32.c Wed May 24 18:35:05 2006 @@ -448,23 +448,16 @@ long showfilewrite(char *a, int n) { - Rune *action, *arg, *cmd; + Rune *arg; static Rune Lopen[] = { 'o', 'p', 'e', 'n', 0 }; + static Rune Lexplorer[] = { 'e', 'x', 'p', 'l', 'o', 'r', 'e', 'r', 0 }; - cmd = runesmprint("%.*s", n, a); - if(cmd == nil) + arg = runesmprint("%.*s", n, a); + if(arg == nil) error("out of memory"); - if(cmd[runestrlen(cmd)-1] == '\n') - cmd[runestrlen(cmd)] = 0; - p = runestrchr(cmd, ' '); - if(p){ - action = cmd; - *p++ = 0; - arg = p; - }else{ - action = Lopen; - arg = cmd; - } - ShellExecute(0, 0, action, arg, 0, SW_SHOWNORMAL); + if(arg[runestrlen(arg)-1] == '\n') + arg[runestrlen(arg)] = 0; + + ShellExecute(0, Lopen, Lexplorer, arg, 0, SW_SHOWNORMAL); return n; } --- /sys/src/cmd/unix/drawterm/libc/Makefile Wed May 24 18:35:26 2006 +++ /sys/src/cmd/unix/drawterm/libc/Makefile Wed May 24 18:35:23 2006 @@ -49,6 +49,8 @@ runesmprint.$O\ runesnprint.$O\ runesprint.$O\ + runestrchr.$O\ + runestrlen.$O\ runetype.$O\ runevseprint.$O\ runevsmprint.$O\ --- /sys/src/cmd/unix/drawterm/libc/fltfmt.c Wed May 24 18:35:47 2006 +++ /sys/src/cmd/unix/drawterm/libc/fltfmt.c Wed May 24 18:35:44 2006 @@ -1,6 +1,6 @@ #include -#include #include +#include #include #include "fmtdef.h"