From d7063d6e64a538f5459c2651a386d14019502992 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Revol?= Date: Sun, 15 Aug 2004 16:37:30 +0000 Subject: [PATCH] open now also handles urls; adds finddir which was lost on my hdd. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@8584 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/bin/Jamfile | 1 + src/apps/bin/open.cpp | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/apps/bin/Jamfile b/src/apps/bin/Jamfile index ca0229e8cf..ced6019928 100644 --- a/src/apps/bin/Jamfile +++ b/src/apps/bin/Jamfile @@ -8,6 +8,7 @@ StdBinCommands driveinfo.c # echo.c eject.c + finddir.c hd.c isvolume.cpp listarea.c diff --git a/src/apps/bin/open.cpp b/src/apps/bin/open.cpp index c8127abf92..e15392ec20 100644 --- a/src/apps/bin/open.cpp +++ b/src/apps/bin/open.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include @@ -21,7 +22,7 @@ main(int argc, char **argv) progName = strrchr(progName, '/') + 1; if (argc < 2) - fprintf(stderr,"usage: %s ...\n", progName); + fprintf(stderr,"usage: %s ...\n", progName); BRoster roster; @@ -44,6 +45,14 @@ main(int argc, char **argv) } else if (!strncasecmp("application/", *argv, 12)) { // maybe it's an application-mimetype? rc = roster.Launch(*argv); + } else if (strstr(*argv, "://")) { + BString mimetype = "application/x-vnd.Be.URL."; + BString arg(*argv); + mimetype.Append(arg, arg.FindFirst("://")); + char *args[2] = { *argv, NULL }; + rc = roster.Launch(mimetype.String(), 1, args); + if (rc == B_ALREADY_RUNNING) + rc = B_OK; } else if (rc == B_OK) rc = B_ENTRY_NOT_FOUND;