- if --enable-static-link is supplied, add -static to LDFLAGS on
Linux if opt_profiling isn't enabled
From a report from Emanuele Torre <torreemanuele6@gmail.com>
+
+print_cmd.c
+ - make_command_string_internal: if we're recursively printing a list
+ (connection) with more than two elements, don't print any deferred
+ here-documents after the make_command_string_internal on the right
+ side of the connection unless we're at the end of the list
+ (printing_connection == 1). This way the caller gets to add the
+ appropriate connector before printing the deferred here-documents.
+ From a report by Grisha Levit <grishalevit@gmail.com>
+ - make_command_string_internal,print_group_command: after we call
+ PRINT_DEFERRED_HEREDOCS and follow it with a closing `)' (subshell)
+ or `}' (group command), we can set was_heredoc to 0 because we are
+ no longer printing a here-document
+ From a report by Grisha Levit <grishalevit@gmail.com>
+
+ 7/3
+ ---
+lib/readline/complete.c
+ - rl_username_completion_function: simplify things by just skipping the
+ function body if HAVE_GETPWENT is not defined.
+ From a report by Grisha Levit <grishalevit@gmail.com>
char *
rl_username_completion_function (const char *text, int state)
{
-#if defined (_WIN32) || defined (__OPENNT)
+#if defined (_WIN32) || defined (__OPENNT) || !defined (HAVE_GETPWENT)
return (char *)NULL;
-#else /* !_WIN32 && !__OPENNT) */
+#else /* !_WIN32 && !__OPENNT) && HAVE_GETPWENT */
static char *username = (char *)NULL;
static struct passwd *entry;
static int namelen, first_char, first_char_loc;
username = savestring (&text[first_char_loc]);
namelen = strlen (username);
-#if defined (HAVE_GETPWENT)
setpwent ();
-#endif
}
-#if defined (HAVE_GETPWENT)
while (entry = getpwent ())
{
/* Null usernames should result in all users as possible completions. */
if (namelen == 0 || (STREQN (username, entry->pw_name, namelen)))
break;
}
-#endif
if (entry == 0)
{
-#if defined (HAVE_GETPWENT)
endpwent ();
-#endif
return ((char *)NULL);
}
else
return (value);
}
-#endif /* !_WIN32 && !__OPENNT */
+#endif /* !_WIN32 && !__OPENNT && HAVE_GETPWENT */
}
/* Return non-zero if CONVFN matches FILENAME up to the length of FILENAME
}
make_command_string_internal (command->value.Connection->second);
- PRINT_DEFERRED_HEREDOCS ("");
+ /* If this is a recursive call to make_command_string_internal to
+ print a connection with more than two components, defer printing
+ the here-document bodies until our caller can print the
+ connector. Remember that the parser builds lists to be left-side
+ heavy. */
+ if (printing_connection == 1)
+ PRINT_DEFERRED_HEREDOCS ("");
printing_connection--;
break;
make_command_string_internal (command->value.Subshell->command);
PRINT_DEFERRED_HEREDOCS ("");
cprintf (" )");
+ was_heredoc = 0; /* last wasn't heredoc/newline */
break;
case cm_coproc:
}
cprintf ("}");
+ was_heredoc = 0; /* last wasn't heredoc/newline */
group_command_nesting--;
}
was_heredoc = 0;
while (redirects)
{
- /* Defer printing the here document bodiess until we've printed the rest of the
+ /* Defer printing the here document bodies until we've printed the rest of the
redirections, but print the headers in the order they're given. */
if (redirects->instruction == r_reading_until || redirects->instruction == r_deblank_reading_until)
{
foo
bar
EOF
- )
+ );
echo after subshell
}
mkcoprocs is a function
producer 1
EOF1
- }
+ };
coproc b {
cat <<EOF2
producer 2
EOF2
- }
+ };
echo "coprocs created"
}
mkcoprocs is a function
heredoc
body
EOF
- )
+ );
echo "coprocs created"
}