Rename fillbuf() to fillargbuf()

This commit is contained in:
sin 2014-01-07 14:56:05 +00:00
parent 20c0a0b1e7
commit e585133012

14
xargs.c
View File

@ -14,7 +14,7 @@ enum {
static int inputc(void); static int inputc(void);
static void deinputc(int); static void deinputc(int);
static void fillbuf(int); static void fillargbuf(int);
static int eatspace(void); static int eatspace(void);
static int parsequote(int); static int parsequote(int);
static int parseescape(void); static int parseescape(void);
@ -121,7 +121,7 @@ deinputc(int ch)
} }
static void static void
fillbuf(int ch) fillargbuf(int ch)
{ {
if (argbpos >= argbsz) { if (argbpos >= argbsz) {
argbsz *= 2; argbsz *= 2;
@ -156,11 +156,11 @@ parsequote(int q)
while ((ch = inputc()) != EOF) { while ((ch = inputc()) != EOF) {
if (ch == q) { if (ch == q) {
fillbuf('\0'); fillargbuf('\0');
return 0; return 0;
} }
if (ch != '\n') { if (ch != '\n') {
fillbuf(ch); fillargbuf(ch);
argbpos++; argbpos++;
} }
} }
@ -173,7 +173,7 @@ parseescape(void)
int ch; int ch;
if ((ch = inputc()) != EOF) { if ((ch = inputc()) != EOF) {
fillbuf(ch); fillargbuf(ch);
argbpos++; argbpos++;
return ch; return ch;
} }
@ -208,14 +208,14 @@ poparg(void)
enprintf(EXIT_FAILURE, "backslash at EOF\n"); enprintf(EXIT_FAILURE, "backslash at EOF\n");
break; break;
default: default:
fillbuf(ch); fillargbuf(ch);
argbpos++; argbpos++;
break; break;
} }
} }
out: out:
if (argbpos > 0) { if (argbpos > 0) {
fillbuf('\0'); fillargbuf('\0');
if (eofstr && strcmp(argb, eofstr) == 0) if (eofstr && strcmp(argb, eofstr) == 0)
return NULL; return NULL;
return argb; return argb;