aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRoss Burton <ross@linux.intel.com>2008-01-29 10:56:14 +0000
committerRoss Burton <ross@linux.intel.com>2008-01-29 10:56:14 +0000
commit77c10d6c0e369af4df789840edf72e392512c31a (patch)
tree7547914c2697769b109cd49665e8cdd2a6e8bbb9
parentdf868a41b79fdffdfe1fee331d2cbcbcd1c1cb50 (diff)
downloadgaku-77c10d6c0e369af4df789840edf72e392512c31a.tar.gz
gaku-77c10d6c0e369af4df789840edf72e392512c31a.tar.bz2
gaku-77c10d6c0e369af4df789840edf72e392512c31a.zip
Handle URIs and filenames on the command line
-rw-r--r--main.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/main.c b/main.c
index 2b85d62..f911555 100644
--- a/main.c
+++ b/main.c
@@ -883,11 +883,17 @@ main (int argc, char **argv)
* Add any files specified on the command line.
*/
for (i = 1; i < argc; i++) {
- char *uri;
- uri = g_filename_to_uri (argv[i], NULL, NULL);
- if (uri) {
- add_uri (data, uri);
- g_free (uri);
+ if (strstr (argv[i], "://")) {
+ /* This argument looks like a URI */
+ add_uri (data, argv[i]);
+ } else {
+ /* This argument is probably a filename, convert to URI */
+ char *uri;
+ uri = g_filename_to_uri (argv[i], NULL, NULL);
+ if (uri) {
+ add_uri (data, uri);
+ g_free (uri);
+ }
}
}