summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorGravatar waker <wakeroid@gmail.com>2009-09-03 22:13:38 +0200
committerGravatar waker <wakeroid@gmail.com>2009-09-03 22:13:38 +0200
commit079989932b65c92ba29cfb078681a581e8d63644 (patch)
treed569980ec84d4572d24c8b8dc7bb379ed08a6359 /main.c
parent0b142452f294a8843c57150de020658dc321671a (diff)
fixed adding files with relative pathnames from commandline
Diffstat (limited to 'main.c')
-rw-r--r--main.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/main.c b/main.c
index ade19e5d..5c0b8f0d 100644
--- a/main.c
+++ b/main.c
@@ -216,12 +216,18 @@ exec_command_line (const char *cmdline, int len, int filter) {
pl_free ();
}
while (parg < pend) {
- if (pl_add_file (parg, NULL, NULL) >= 0) {
- if (queue) {
- exitcode = 3;
- }
- else {
- exitcode = 2;
+ char resolved[PATH_MAX];
+ if (!realpath (parg, resolved)) {
+ fprintf (stderr, "error: cannot expand filename %s, file will not play\n", parg);
+ }
+ else {
+ if (pl_add_file (resolved, NULL, NULL) >= 0) {
+ if (queue) {
+ exitcode = 3;
+ }
+ else {
+ exitcode = 2;
+ }
}
}
parg += strlen (parg);