From 6af6311f368442e189a95e9412672fbfbc5fee90 Mon Sep 17 00:00:00 2001 From: Jonathan Wilkes <jon.w.wilkes@gmail.com> Date: Sat, 28 Jan 2017 17:40:44 -0500 Subject: [PATCH] improve readability of preferences reader script for OSX --- pd/src/s_file.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pd/src/s_file.c b/pd/src/s_file.c index 9dc97b44b..3c4873760 100644 --- a/pd/src/s_file.c +++ b/pd/src/s_file.c @@ -326,7 +326,14 @@ static void sys_initloadpreferences(void) // "loadlib1" : "libdir", loadlib1: libdir // "path1" : "\/System\/Library\/Fonts" path1: /System/Library/Fonts // } - snprintf(cmdbuf, MAXPDSTRING, "defaults export %s - | plutil -convert json -r -o - - | sed -E -e 's/[{}]//g' -e 's/^ *\"(([^\"]|\\\\.)*)\" *: *\"(([^\"]|\\\\.)*)\".*/\\1: \\3/' -e 's/\\\\(.)/\\1/g'", prefs); + snprintf(cmdbuf, MAXPDSTRING, + "defaults export %s - " + "| plutil -convert json -r -o - - " + "| sed -E " + "-e 's/[{}]//g' " + "-e 's/^ *\"(([^\"]|\\\\.)*)\" *: *\"(([^\"]|\\\\.)*)\".*/\\1: \\3/' " + "-e 's/\\\\(.)/\\1/g'", + prefs); // open the pipe fp = popen(cmdbuf, "r"); if (!fp) { -- GitLab