Lines Matching refs:cp

635 append(char *cp, char ***ap, size_t *np)  in append()  argument
641 tmp[(*np)] = cp; in append()
710 char *cp; in emit_expansion() local
713 if ((cp = malloc(brace_start + (sel_end - sel_start) + in emit_expansion()
719 memcpy(cp, pattern, brace_start); in emit_expansion()
724 memcpy(cp + o, pattern + sel_start, in emit_expansion()
730 memcpy(cp + o, pattern + brace_end + 1, tail_len); in emit_expansion()
733 cp[o] = '\0'; in emit_expansion()
734 if (append(cp, patternsp, npatternsp) != 0) { in emit_expansion()
735 free(cp); in emit_expansion()
818 char *cp, *cp2, **active = NULL, **done = NULL; in brace_expand() local
826 if ((cp = strdup(pattern)) == NULL) in brace_expand()
828 if (append(cp, &active, &nactive) != 0) { in brace_expand()
829 free(cp); in brace_expand()
833 cp = active[nactive - 1]; in brace_expand()
835 if (brace_expand_one(cp, &active, &nactive, in brace_expand()
837 free(cp); in brace_expand()
841 fatal("%s: invalid brace pattern \"%s\"", __func__, cp); in brace_expand()
847 free(cp); in brace_expand()
854 if ((cp2 = strrchr(cp, '/')) != NULL) in brace_expand()
857 cp2 = cp; in brace_expand()
859 free(cp); in brace_expand()
862 free(cp); in brace_expand()
1242 char ch, *cp, *np, *targ, *why, *vect[1], buf[2048], visbuf[2048]; local
1278 cp = buf;
1279 if (atomicio(read, remin, cp, 1) != 1)
1281 if (*cp++ == '\n')
1286 *cp++ = ch;
1287 } while (cp < &buf[sizeof(buf) - 1] && ch != '\n');
1288 *cp = 0;
1309 *--cp = 0;
1311 cp = buf;
1312 if (*cp == 'T') {
1314 cp++;
1315 if (!isdigit((unsigned char)*cp))
1317 ull = strtoull(cp, &cp, 10);
1318 if (!cp || *cp++ != ' ')
1323 mtime.tv_usec = strtol(cp, &cp, 10);
1324 if (!cp || *cp++ != ' ' || mtime.tv_usec < 0 ||
1327 if (!isdigit((unsigned char)*cp))
1329 ull = strtoull(cp, &cp, 10);
1330 if (!cp || *cp++ != ' ')
1335 atime.tv_usec = strtol(cp, &cp, 10);
1336 if (!cp || *cp++ != '\0' || atime.tv_usec < 0 ||
1342 if (*cp != 'C' && *cp != 'D') {
1351 run_err("%s", cp);
1357 for (++cp; cp < buf + 5; cp++) {
1358 if (*cp < '0' || *cp > '7')
1360 mode = (mode << 3) | (*cp - '0');
1364 if (*cp++ != ' ')
1367 if (!isdigit((unsigned char)*cp))
1369 ull = strtoull(cp, &cp, 10);
1370 if (!cp || *cp++ != ' ')
1376 if (*cp == '\0' || strchr(cp, '/') != NULL ||
1377 strcmp(cp, ".") == 0 || strcmp(cp, "..") == 0) {
1378 run_err("error: unexpected filename: %s", cp);
1383 if (fnmatch(patterns[n], cp, 0) == 0)
1394 need = strlen(targ) + strlen(cp) + 250;
1401 strcmp(targ, "/") ? "/" : "", cp);
1405 curfile = cp;
1449 cp = bp->buf;
1462 j = atomicio6(read, remin, cp, amt,
1471 cp += j;
1484 cp = bp->buf;
1563 char ch, *cp, resp, rbuf[2048], visbuf[2048]; local
1568 cp = rbuf;
1573 *cp++ = resp;
1580 *cp++ = ch;
1581 } while (cp < &rbuf[sizeof(rbuf) - 1] && ch != '\n');
1584 cp[-1] = '\0';
1634 verifydir(char *cp) argument
1638 if (!stat(cp, &stb)) {
1643 run_err("%s: %s", cp, strerror(errno));
1651 char *cp; local
1653 cp = cp0;
1655 c = (int)*cp;
1670 } while (*++cp);