Lines 745-773
subshell_name_quote (const char *s)
Link Here
|
745 |
memcpy (d, cmd_start, len); |
745 |
memcpy (d, cmd_start, len); |
746 |
d += len; |
746 |
d += len; |
747 |
|
747 |
|
748 |
/* |
|
|
749 |
* Print every character in octal format with the leading backslash. |
750 |
* tcsh and zsh may require 4-digit octals, bash < 2.05b doesn't like them. |
751 |
*/ |
752 |
if (subshell_type == BASH) { |
753 |
for (; *s; s++) { |
748 |
for (; *s; s++) { |
754 |
/* Must quote numbers, so that they are not glued to octals */ |
|
|
755 |
if (isalpha ((unsigned char) *s)) { |
749 |
if (isalpha ((unsigned char) *s)) { |
756 |
*d++ = (unsigned char) *s; |
750 |
*d++ = (unsigned char) *s; |
757 |
} else { |
751 |
} else { |
758 |
sprintf (d, "\\%03o", (unsigned char) *s); |
|
|
759 |
d += 4; |
760 |
} |
761 |
} |
762 |
} else { |
763 |
for (; *s; s++) { |
764 |
if (isalnum ((unsigned char) *s)) { |
765 |
*d++ = (unsigned char) *s; |
766 |
} else { |
767 |
sprintf (d, "\\0%03o", (unsigned char) *s); |
752 |
sprintf (d, "\\0%03o", (unsigned char) *s); |
768 |
d += 5; |
753 |
d += 5; |
769 |
} |
754 |
} |
770 |
} |
|
|
771 |
} |
755 |
} |
772 |
|
756 |
|
773 |
memcpy (d, common_end, sizeof (common_end)); |
757 |
memcpy (d, common_end, sizeof (common_end)); |