From a20505de42afff7ecbdf4954b97fdcc9e68da9f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Gr=C3=A4f?= <aggraef@gmail.com> Date: Mon, 23 Jan 2017 16:58:49 +0100 Subject: [PATCH] Comment change (#230). --- 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 b12b34e98..c52ccaf4c 100644 --- a/pd/src/s_file.c +++ b/pd/src/s_file.c @@ -285,7 +285,14 @@ static void sys_initloadpreferences(void) // 1. defaults export: grab our defaults in XML format // 2. plutil -convert json -r -o - -: convert to JSON // 3. sed: a few edits remove the extra JSON bits (curly brances, string - // quotes, unwanted whitespace and character escapes) + // quotes, unwanted whitespace and character escapes) and produce + // Pd-L2Ork's Unix prefs format, i.e.: + // JSON --> Unix prefs + // { + // "nloadlib" : "33", nloadlib: 33 + // "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'", current_prefs); // open the pipe fp = popen(cmdbuf, "r"); -- GitLab