Thread View: gnu.bash.bug
1 messages
1 total messages
Started by Ray Moody
Tue, 13 Jun 1989 21:15
quoted quotes don't work.
Author: Ray Moody
Date: Tue, 13 Jun 1989 21:15
Date: Tue, 13 Jun 1989 21:15
209 lines
4503 bytes
4503 bytes
Quoted quotes do not work in bash. For example
echo "a \"$PS2\" b" should print: a "bash>" b
but really prints: a bash> b
Ray
-------------------------------------------------------------------------------
RCS file: RCS/subst.c,v
retrieving revision 0.99.1.1
diff -c -r0.99.1.1 subst.c
*** /tmp/,RCSt1019034 Tue Jun 13 16:13:52 1989
--- subst.c Tue Jun 13 16:05:52 1989
***************
*** 1004,1012
}
case '"':
! index++;
! {
! WORD_LIST *tresult = (WORD_LIST *)NULL;
t_index = index;
temp = string_extract_double_quoted (string, &t_index);
--- 1004,1016 -----
}
case '"':
! /* Fixed Tue Jun 13 16:04:05 EST 1989 by Ray Moody */
! /* If a " is quoted, it is just an ordinary character */
! if (!quoted)
! {
! index++;
! {
! WORD_LIST *tresult = (WORD_LIST *)NULL;
t_index = index;
temp = string_extract_double_quoted (string, &t_index);
***************
*** 1008,1016
{
WORD_LIST *tresult = (WORD_LIST *)NULL;
! t_index = index;
! temp = string_extract_double_quoted (string, &t_index);
! index = t_index;
if (string[index])
index++;
--- 1012,1020 -----
{
WORD_LIST *tresult = (WORD_LIST *)NULL;
! t_index = index;
! temp = string_extract_double_quoted (string, &t_index);
! index = t_index;
if (string[index])
index++;
***************
*** 1012,1019
temp = string_extract_double_quoted (string, &t_index);
index = t_index;
! if (string[index])
! index++;
tresult = expand_string (temp, 1);
free (temp);
--- 1016,1023 -----
temp = string_extract_double_quoted (string, &t_index);
index = t_index;
! if (string[index])
! index++;
tresult = expand_string (temp, 1);
free (temp);
***************
*** 1015,1022
if (string[index])
index++;
! tresult = expand_string (temp, 1);
! free (temp);
if (tresult)
{
--- 1019,1026 -----
if (string[index])
index++;
! tresult = expand_string (temp, 1);
! free (temp);
if (tresult)
{
***************
*** 1018,1030
tresult = expand_string (temp, 1);
free (temp);
! if (tresult)
! {
! temp = savestring (tresult->word->word);
! dispose_words (tresult);
! }
! else
! temp = (char *)NULL;
add_quoted_string:
--- 1022,1034 -----
tresult = expand_string (temp, 1);
free (temp);
! if (tresult)
! {
! temp = savestring (tresult->word->word);
! dispose_words (tresult);
! }
! else
! temp = (char *)NULL;
add_quoted_string:
***************
*** 1026,1032
else
temp = (char *)NULL;
! add_quoted_string:
if (temp)
{
--- 1030,1036 -----
else
temp = (char *)NULL;
! add_quoted_string:
if (temp)
{
***************
*** 1028,1037
add_quoted_string:
! if (temp)
! {
! register char *tt;
! for (tt = temp; *tt && (*tt |= 0x80); tt++);
}
else
{
--- 1032,1049 -----
add_quoted_string:
! if (temp)
! {
! register char *tt;
! for (tt = temp; *tt && (*tt |= 0x80); tt++);
! }
! else
! {
! add_null_arg:
! temp = savestring (" ");
! temp[0] = (unsigned char)0x80;
! }
! goto add_string;
}
}
else
***************
*** 1033,1046
register char *tt;
for (tt = temp; *tt && (*tt |= 0x80); tt++);
}
! else
! {
! add_null_arg:
! temp = savestring (" ");
! temp[0] = (unsigned char)0x80;
! }
! goto add_string;
! }
break;
--- 1045,1053 -----
}
goto add_string;
}
! }
! else
! goto add_character;
break;
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads