#include <stdio.h>
#include "syntax.h"
-
-extern char *xmalloc ();
+#include <xmalloc.h>
/* **************************************************************** */
/* */
register int c;
char *result, *r, *s;
- result = xmalloc (3 + (4 * strlen (string)));
+ result = (char *)xmalloc (3 + (4 * strlen (string)));
r = result;
*r++ = '\'';
sh_double_quote (string)
char *string;
{
- register int c;
+ register unsigned char c;
char *result, *r, *s;
- result = xmalloc (3 + (2 * strlen (string)));
+ result = (char *)xmalloc (3 + (2 * strlen (string)));
r = result;
*r++ = '"';
register int c, pass_next;
char *result, *r, *s;
- r = result = xmalloc (strlen (string) + 1);
+ r = result = (char *)xmalloc (strlen (string) + 1);
for (pass_next = 0, s = string; s && (c = *s); s++)
{
pass_next = 0;
continue;
}
- if (c == '\\' && (sh_syntaxtab[s[1]] & CBSDQUOTE))
+ if (c == '\\' && (sh_syntaxtab[(unsigned char) s[1]] & CBSDQUOTE))
{
pass_next = 1;
continue;
int c;
char *result, *r, *s;
- result = xmalloc (2 * strlen (string) + 1);
+ result = (char *)xmalloc (2 * strlen (string) + 1);
for (r = result, s = string; s && (c = *s); s++)
{
sh_backslash_quote_for_double_quotes (string)
char *string;
{
- int c;
+ unsigned char c;
char *result, *r, *s;
- result = xmalloc (2 * strlen (string) + 1);
+ result = (char *)xmalloc (2 * strlen (string) + 1);
for (r = result, s = string; s && (c = *s); s++)
{
case '~': /* tilde expansion */
if (s == string || s[-1] == '=' || s[-1] == ':')
return (1);
+ break;
case '#':
if (s == string) /* comment char */
return (1);