- {
- char *start_var = dollar + 1;
- char *end_var = start_var;
- char *start_next = end_var;
-
- out += string (ptr, dollar - ptr);
- ptr = dollar;
-
- if (*start_var == '{')
- {
- start_var ++;
-
- end_var = strchr (start_var, '}');
-
- if (end_var == NULL)
- {
- end_var = start_var + len;
- start_next = end_var;
- }
- else
- {
- start_next = end_var + 1;
- }
- }
- else
- {
- /*
- Hmm. what to do for $1 , $~ etc.?
- */
- do
- {
- end_var ++;
- }
- while (isalnum (*end_var) || *end_var == '_');
- start_next = end_var;
- }
-
- if (start_var < end_var)
- {
- string var_name (start_var, end_var - start_var);
- const char *value = getenv (var_name.c_str());
- if (value != NULL)
- out += string (value);
-
- ptr = start_next;
- }
- }
+ {
+ char const *start_var = dollar + 1;
+ char const *end_var = start_var;
+ char const *start_next = end_var;
+
+ out += string (ptr, dollar - ptr);
+ ptr = dollar;
+
+ if (*start_var == '{')
+ {
+ start_var++;
+
+ end_var = strchr (start_var, '}');
+
+ if (end_var == NULL)
+ {
+ end_var = start_var + len;
+ start_next = end_var;
+ }
+ else
+ {
+ start_next = end_var + 1;
+ }
+ }
+ else
+ {
+ /*
+ Hmm. what to do for $1 , $~ etc.?
+ */
+ do
+ {
+ end_var++;
+ }
+ while (isalnum (*end_var) || *end_var == '_');
+ start_next = end_var;
+ }
+
+ if (start_var < end_var)
+ {
+ string var_name (start_var, end_var - start_var);
+ char const *value = getenv (var_name.c_str ());
+ if (value != NULL)
+ out += string (value);
+
+ ptr = start_next;
+ }
+ }