aboutsummaryrefslogtreecommitdiff
path: root/src/librc-misc.c
diff options
context:
space:
mode:
authorRoy Marples <roy@marples.name>2007-07-09 10:26:02 +0000
committerRoy Marples <roy@marples.name>2007-07-09 10:26:02 +0000
commit53d17a1be2f9a47cec9e663905fbe1ee3637e050 (patch)
treec28d852eab9f9719757e34bc128f2abd17444361 /src/librc-misc.c
parente03844fd26cf5b6f01949e1c3ded14e5b4d812ec (diff)
Add an option to fork ldconfig in env-update, #182794. Also, preserve the entire line in /etc/env.d/foo if it begins with $
Diffstat (limited to 'src/librc-misc.c')
-rw-r--r--src/librc-misc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/librc-misc.c b/src/librc-misc.c
index f527ef11..6436e0b4 100644
--- a/src/librc-misc.c
+++ b/src/librc-misc.c
@@ -336,10 +336,14 @@ char **rc_get_config (char **list, const char *file)
entry = rc_xstrdup (token);
- do {
- /* Bash variables are usually quoted */
- token = strsep (&p, "\"\'");
- } while ((token) && (strlen (token) == 0));
+ /* Preserve shell coloring */
+ if (*p == '$')
+ token = p;
+ else
+ do {
+ /* Bash variables are usually quoted */
+ token = strsep (&p, "\"\'");
+ } while ((token) && (strlen (token) == 0));
/* Drop a newline if that's all we have */
i = strlen (token) - 1;