summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/main.c b/main.c
index 3fc1715e..fc079dae 100644
--- a/main.c
+++ b/main.c
@@ -240,17 +240,19 @@ exec_command_line (const char *cmdline, int len, int filter) {
}
while (parg < pend) {
char resolved[PATH_MAX];
- if (!realpath (parg, resolved)) {
- fprintf (stderr, "error: cannot expand filename %s, file will not play\n", parg);
+ const char *pname;
+ if (realpath (parg, resolved)) {
+ pname = resolved;
}
else {
- if (pl_add_file (resolved, NULL, NULL) >= 0) {
- if (queue) {
- exitcode = 3;
- }
- else {
- exitcode = 2;
- }
+ pname = parg;
+ }
+ if (pl_add_file (pname, NULL, NULL) >= 0) {
+ if (queue) {
+ exitcode = 3;
+ }
+ else {
+ exitcode = 2;
}
}
parg += strlen (parg);