summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-05-03 14:52:11 +0200
committerwm4 <wm4@nowhere>2015-05-03 14:52:11 +0200
commit2ae96f567cf63dca595a37fd57d63d8d27a7a186 (patch)
tree6895b1fa4423db6d0bd971d663fe77a38fe0fa1c
parent6a03357b7123e5b3c59d3038c3dae491384a08ef (diff)
downloadmpv-2ae96f567cf63dca595a37fd57d63d8d27a7a186.tar.bz2
mpv-2ae96f567cf63dca595a37fd57d63d8d27a7a186.tar.xz
path: start special espansion with ~~name instead of ~name
Since commit 7381db60, strings like "~desktop/" were expanded as platform-specific paths by mpv. Apparently this similarity to standard Unix shell expansion caused confusion, so change it to "~~desktop/". The shell doesn't expand this, so it should be better.
-rw-r--r--DOCS/man/mpv.rst18
-rw-r--r--options/path.c2
-rw-r--r--player/main.c2
3 files changed, 11 insertions, 11 deletions
diff --git a/DOCS/man/mpv.rst b/DOCS/man/mpv.rst
index 653c29d9ce..840f64d92a 100644
--- a/DOCS/man/mpv.rst
+++ b/DOCS/man/mpv.rst
@@ -332,14 +332,14 @@ Some mpv options interpret paths starting with ``~``. Currently, the prefix
``~/`` expands to the user's home directory. (The trailing ``/`` is always
required.) There are the following paths as well:
-=============== ================================================================
-Name Meaning
-=============== ================================================================
-``~home/`` same as ``~~/``
-``~global/`` the global config path, if available
-``~osxbundle/`` the OSX bundle resource path (OSX only)
-``~desktop/`` the path to the desktop (win32, OSX)
-=============== ================================================================
+================ ===============================================================
+Name Meaning
+================ ===============================================================
+``~~home/`` same as ``~~/``
+``~~global/`` the global config path, if available (not on win32)
+``~~osxbundle/`` the OSX bundle resource path (OSX only)
+``~~desktop/`` the path to the desktop (win32, OSX)
+================ ===============================================================
Per-File Options
@@ -648,7 +648,7 @@ the ``pseudo-gui`` profile being predefined with the following contents:
terminal=no
force-window=yes
idle=once
- screenshot-directory=~desktop/
+ screenshot-directory=~~desktop/
This follows the mpv config file format. To customize pseudo-GUI mode, you can
put your own ``pseudo-gui`` profile into your ``mpv.conf``. This profile will
diff --git a/options/path.c b/options/path.c
index 742e292eb1..ddcc8d1ece 100644
--- a/options/path.c
+++ b/options/path.c
@@ -182,7 +182,7 @@ char *mp_get_user_path(void *talloc_ctx, struct mpv_global *global,
res = mp_find_config_file(talloc_ctx, global, rest0);
} else if (bstr_equals0(prefix, "")) {
res = mp_path_join(talloc_ctx, bstr0(getenv("HOME")), rest);
- } else {
+ } else if (bstr_eatstart0(&prefix, "~")) {
char type[80];
snprintf(type, sizeof(type), "%.*s", BSTR_P(prefix));
const char *p = mp_get_platform_path(talloc_ctx, type);
diff --git a/player/main.c b/player/main.c
index ff7450f164..c227db7b1e 100644
--- a/player/main.c
+++ b/player/main.c
@@ -100,7 +100,7 @@ static const char def_config[] =
"terminal=no\n"
"force-window=yes\n"
"idle=once\n"
- "screenshot-directory=~desktop/\n";
+ "screenshot-directory=~~desktop/\n";
static pthread_mutex_t terminal_owner_lock = PTHREAD_MUTEX_INITIALIZER;
static struct MPContext *terminal_owner;