t = w->word->word;
if (t == 0 || *t == '\0')
fprintf (stderr, "''%s", w->next ? " " : "");
- else if (contains_shell_metas (t))
+ else if (sh_contains_shell_metas (t))
{
- x = single_quote (t);
+ x = sh_single_quote (t);
fprintf (stderr, "%s%s", x, w->next ? " " : "");
free (x);
}
cprintf (" ]]");
}
+#ifdef DEBUG
void
debug_print_cond_command (cond)
COND_COM *cond;
print_cond_command (cond);
fprintf (stderr, "%s\n", the_printed_command);
}
+#endif
void
xtrace_print_cond_term (type, invert, op, arg1, arg2)
{
cprintf (" ");
for (hdtail = heredocs; hdtail; hdtail = hdtail->next)
- {
+ {
print_redirection (hdtail);
cprintf ("\n");
- }
+ }
dispose_redirects (heredocs);
was_heredoc = 1;
}
cprintf ("%d", redirector);
/* If the here document delimiter is quoted, single-quote it. */
if (redirect->redirectee.filename->flags & W_QUOTED)
- {
- char *x;
- x = single_quote (redirect->here_doc_eof);
+ {
+ char *x;
+ x = sh_single_quote (redirect->here_doc_eof);
cprintf ("<<%s%s\n", kill_leading? "-" : "", x);
- free (x);
- }
+ free (x);
+ }
else
cprintf ("<<%s%s\n", kill_leading? "-" : "", redirect->here_doc_eof);
cprintf ("%s%s",
inside_function_def++;
indentation += indentation_amount;
- func_redirects = (REDIRECT *)NULL;
cmdcopy = copy_command (func->command);
if (cmdcopy->type == cm_group)
{
- func_redirects = cmdcopy->value.Group->command->redirects;
- cmdcopy->value.Group->command->redirects = (REDIRECT *)NULL;
+ func_redirects = cmdcopy->redirects;
+ cmdcopy->redirects = (REDIRECT *)NULL;
}
make_command_string_internal (cmdcopy->type == cm_group
? cmdcopy->value.Group->command
{ /* { */
newline ("} ");
print_redirection_list (func_redirects);
- cmdcopy->value.Group->command->redirects = func_redirects;
+ cmdcopy->redirects = func_redirects;
}
else
newline ("}");
func_redirects = (REDIRECT *)NULL;
if (cmdcopy->type == cm_group)
{
- func_redirects = cmdcopy->value.Group->command->redirects;
- cmdcopy->value.Group->command->redirects = (REDIRECT *)NULL;
+ func_redirects = cmdcopy->redirects;
+ cmdcopy->redirects = (REDIRECT *)NULL;
}
make_command_string_internal (cmdcopy->type == cm_group
? cmdcopy->value.Group->command
{ /* { */
newline ("} ");
print_redirection_list (func_redirects);
- cmdcopy->value.Group->command->redirects = func_redirects;
+ cmdcopy->redirects = func_redirects;
}
else
newline ("}");
}
#else
if (result[2] == '\n') /* XXX -- experimental */
- strcpy (result + 2, result + 3);
+ strcpy (result + 2, result + 3);
#endif
}