version 1.8, 2003/06/03 02:56:08 |
version 1.9, 2003/06/26 07:27:29 |
|
|
|
|
#include <sys/types.h> |
#include <sys/types.h> |
#include <sys/stat.h> |
#include <sys/stat.h> |
|
#include <sys/uio.h> |
|
|
#include <err.h> |
#include <err.h> |
#include <errno.h> |
#include <errno.h> |
|
|
* Replace occurrences of {} in s1 with s2 and return the result string. |
* Replace occurrences of {} in s1 with s2 and return the result string. |
*/ |
*/ |
void |
void |
brace_subst(orig, store, path, len) |
brace_subst(char *orig, char **store, char *path, int len) |
char *orig, **store, *path; |
|
int len; |
|
{ |
{ |
int plen; |
int plen; |
char ch, *p; |
char ch, *p; |
|
|
* input. If the input is 'y' then 1 is returned. |
* input. If the input is 'y' then 1 is returned. |
*/ |
*/ |
int |
int |
queryuser(argv) |
queryuser(char **argv) |
char **argv; |
|
{ |
{ |
int ch, first, nl; |
int ch, first, nl; |
|
|
|
|
* malloc with error checking. |
* malloc with error checking. |
*/ |
*/ |
void * |
void * |
emalloc(len) |
emalloc(u_int len) |
u_int len; |
|
{ |
{ |
void *p; |
void *p; |
|
|
|
|
*/ |
*/ |
/* ARGSUSED */ |
/* ARGSUSED */ |
void |
void |
show_path(sig) |
show_path(int signo) |
int sig; |
|
{ |
{ |
int save_errno = errno; |
int save_errno = errno; |
extern FTSENT *entry; |
extern FTSENT *entry; |
|
struct iovec iov[3]; |
|
|
if (entry != NULL) { |
if (entry != NULL) { |
write(STDERR_FILENO, "find path: ", 11); |
iov[0].iov_base = "find path: "; |
write(STDERR_FILENO, entry->fts_path, entry->fts_pathlen); |
iov[0].iov_len = strlen(iov[0].iov_base); |
write(STDERR_FILENO, "\n", 1); |
iov[1].iov_base = entry->fts_path; |
|
iov[1].iov_len = entry->fts_pathlen; |
|
iov[2].iov_base = "\n"; |
|
iov[2].iov_len = strlen(iov[2].iov_base); |
|
writev(STDERR_FILENO, iov, 3); |
errno = save_errno; |
errno = save_errno; |
} |
} |
} |
} |