Lines Matching refs:cp

637 append(char *cp, char ***ap, size_t *np)  in append()  argument
643 tmp[(*np)] = cp; in append()
712 char *cp; in emit_expansion() local
715 if ((cp = malloc(brace_start + (sel_end - sel_start) + in emit_expansion()
721 memcpy(cp, pattern, brace_start); in emit_expansion()
726 memcpy(cp + o, pattern + sel_start, in emit_expansion()
732 memcpy(cp + o, pattern + brace_end + 1, tail_len); in emit_expansion()
735 cp[o] = '\0'; in emit_expansion()
736 if (append(cp, patternsp, npatternsp) != 0) { in emit_expansion()
737 free(cp); in emit_expansion()
820 char *cp, *cp2, **active = NULL, **done = NULL; in brace_expand() local
828 if ((cp = strdup(pattern)) == NULL) in brace_expand()
830 if (append(cp, &active, &nactive) != 0) { in brace_expand()
831 free(cp); in brace_expand()
835 cp = active[nactive - 1]; in brace_expand()
837 if (brace_expand_one(cp, &active, &nactive, in brace_expand()
839 free(cp); in brace_expand()
843 fatal("%s: invalid brace pattern \"%s\"", __func__, cp); in brace_expand()
849 free(cp); in brace_expand()
856 if ((cp2 = strrchr(cp, '/')) != NULL) in brace_expand()
859 cp2 = cp; in brace_expand()
861 free(cp); in brace_expand()
864 free(cp); in brace_expand()
1244 char ch, *cp, *np, *targ, *why, *vect[1], buf[2048], visbuf[2048]; local
1280 cp = buf;
1281 if (atomicio(read, remin, cp, 1) != 1)
1283 if (*cp++ == '\n')
1288 *cp++ = ch;
1289 } while (cp < &buf[sizeof(buf) - 1] && ch != '\n');
1290 *cp = 0;
1311 *--cp = 0;
1313 cp = buf;
1314 if (*cp == 'T') {
1316 cp++;
1317 if (!isdigit((unsigned char)*cp))
1319 ull = strtoull(cp, &cp, 10);
1320 if (!cp || *cp++ != ' ')
1325 mtime.tv_usec = strtol(cp, &cp, 10);
1326 if (!cp || *cp++ != ' ' || mtime.tv_usec < 0 ||
1329 if (!isdigit((unsigned char)*cp))
1331 ull = strtoull(cp, &cp, 10);
1332 if (!cp || *cp++ != ' ')
1337 atime.tv_usec = strtol(cp, &cp, 10);
1338 if (!cp || *cp++ != '\0' || atime.tv_usec < 0 ||
1344 if (*cp != 'C' && *cp != 'D') {
1353 run_err("%s", cp);
1359 for (++cp; cp < buf + 5; cp++) {
1360 if (*cp < '0' || *cp > '7')
1362 mode = (mode << 3) | (*cp - '0');
1366 if (*cp++ != ' ')
1369 if (!isdigit((unsigned char)*cp))
1371 ull = strtoull(cp, &cp, 10);
1372 if (!cp || *cp++ != ' ')
1378 if (*cp == '\0' || strchr(cp, '/') != NULL ||
1379 strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) {
1380 run_err("error: unexpected filename: %s", cp);
1385 if (fnmatch(patterns[n], cp, 0) == 0)
1396 need = strlen(targ) + strlen(cp) + 250;
1403 strcmp(targ, "/") ? "/" : "", cp);
1407 curfile = cp;
1451 cp = bp->buf;
1464 j = atomicio6(read, remin, cp, amt,
1473 cp += j;
1486 cp = bp->buf;
1565 char ch, *cp, resp, rbuf[2048], visbuf[2048]; local
1570 cp = rbuf;
1575 *cp++ = resp;
1582 *cp++ = ch;
1583 } while (cp < &rbuf[sizeof(rbuf) - 1] && ch != '\n');
1586 cp[-1] = '\0';
1636 verifydir(char *cp) argument
1640 if (!stat(cp, &stb)) {
1645 run_err("%s: %s", cp, strerror(errno));
1653 char *cp; local
1655 cp = cp0;
1657 c = (int)*cp;
1672 } while (*++cp);