version 1.15, 2016/03/16 15:36:26 |
version 1.16, 2016/09/17 15:06:41 |
|
|
/* |
/* |
* Make room for the new character (shift the tail of the buffer right). |
* Make room for the new character (shift the tail of the buffer right). |
*/ |
*/ |
for (s = &cmdbuf[strlen(cmdbuf)]; s >= cp; s--) |
for (s = &cmdbuf[strlen(cmdbuf)]; s >= cp; s--) |
s[clen] = s[0]; |
s[clen] = s[0]; |
/* |
/* |
* Insert the character into the buffer. |
* Insert the character into the buffer. |
*/ |
*/ |
for (s = cp; s < cp + clen; s++) |
for (s = cp; s < cp + clen; s++) |
*s = *cs++; |
*s = *cs++; |
/* |
/* |
* Reprint the tail of the line from the inserted char. |
* Reprint the tail of the line from the inserted char. |
|
|
* without a corresponding close quote), we return everything |
* without a corresponding close quote), we return everything |
* from the open quote, including spaces. |
* from the open quote, including spaces. |
*/ |
*/ |
for (word = cmdbuf; word < cp; word++) |
for (word = cmdbuf; word < cp; word++) |
if (*word != ' ') |
if (*word != ' ') |
break; |
break; |
if (word >= cp) |
if (word >= cp) |
return (cp); |
return (cp); |
for (p = cmdbuf; p < cp; p++) { |
for (p = cmdbuf; p < cp; p++) { |
if (meta_quoted) { |
if (meta_quoted) { |
meta_quoted = 0; |
meta_quoted = 0; |
} else if (esclen > 0 && p + esclen < cp && |
} else if (esclen > 0 && p + esclen < cp && |
|
|
off_t n = 0; |
off_t n = 0; |
int err; |
int err; |
|
|
for (p = cmdbuf; *p >= '0' && *p <= '9'; p++) |
for (p = cmdbuf; *p >= '0' && *p <= '9'; p++) |
n = (n * 10) + (*p - '0'); |
n = (n * 10) + (*p - '0'); |
*frac = 0; |
*frac = 0; |
if (*p++ == '.') { |
if (*p++ == '.') { |
|
|
return; |
return; |
} |
} |
while (fgets(line, sizeof (line), f) != NULL) { |
while (fgets(line, sizeof (line), f) != NULL) { |
for (p = line; *p != '\0'; p++) { |
for (p = line; *p != '\0'; p++) { |
if (*p == '\n' || *p == '\r') { |
if (*p == '\n' || *p == '\r') { |
*p = '\0'; |
*p = '\0'; |
break; |
break; |
|
|
histsize = 100; |
histsize = 100; |
|
|
ml = ml->prev; |
ml = ml->prev; |
for (n = 0; n < histsize; n++) { |
for (n = 0; n < histsize; n++) { |
if (ml->string == NULL) |
if (ml->string == NULL) |
break; |
break; |
ml = ml->prev; |
ml = ml->prev; |
} |
} |
for (ml = ml->next; ml->string != NULL; ml = ml->next) |
for (ml = ml->next; ml->string != NULL; ml = ml->next) |
(void) fprintf(f, "\"%s\n", ml->string); |
(void) fprintf(f, "\"%s\n", ml->string); |
} |
} |
|
|