version 1.12, 2003/04/05 20:31:58 |
version 1.13, 2003/04/19 17:22:29 |
|
|
extern struct cmd *cmds; /* Initialized by yyparse() */ |
extern struct cmd *cmds; /* Initialized by yyparse() */ |
time_t lastmod; /* Last modify time */ |
time_t lastmod; /* Last modify time */ |
|
|
extern char target[]; |
extern char target[BUFSIZ]; |
extern char *ptarget; |
extern char *ptarget; |
extern int activechildren; |
extern int activechildren; |
extern int maxchildren; |
extern int maxchildren; |
|
|
* first time cmptime() is called? |
* first time cmptime() is called? |
*/ |
*/ |
if (ptarget == NULL) { |
if (ptarget == NULL) { |
if (exptilde(target, name) == NULL) |
if (exptilde(target, name, sizeof(target)) == NULL) |
return; |
return; |
ptarget = name = target; |
ptarget = name = target; |
while (*ptarget) |
while (*ptarget) |
|
|
E_LOCFILE, name, sc->sc_name); |
E_LOCFILE, name, sc->sc_name); |
message(MT_CHANGE, "special \"%s\"", buf); |
message(MT_CHANGE, "special \"%s\"", buf); |
if (*env) { |
if (*env) { |
int len = strlen(*env); |
size_t len = strlen(*env) + strlen(name) + 2; |
*env = (char *) xrealloc(*env, len + |
*env = (char *) xrealloc(*env, len); |
strlen(name) + 2); |
(void) strlcat(*env, name, len); |
*env[len] = CNULL; |
(void) strlcat(*env, ":", len); |
(void) strcat(*env, name); |
|
(void) strcat(*env, ":"); |
|
} |
} |
if (IS_ON(options, DO_VERIFY)) |
if (IS_ON(options, DO_VERIFY)) |
continue; |
continue; |
|
|
if (sc->sc_type == NOTIFY) |
if (sc->sc_type == NOTIFY) |
notify(NULL, sc->sc_args, (time_t)lastmod); |
notify(NULL, sc->sc_args, (time_t)lastmod); |
else if (sc->sc_type == CMDSPECIAL && env) { |
else if (sc->sc_type == CMDSPECIAL && env) { |
char *p; |
size_t len = strlen(env); |
int len = strlen(env); |
if (env[len - 1] == ':') |
|
env[--len] = CNULL; |
env = xrealloc(env, |
len += 2 + strlen(sc->sc_name) + 1; |
len + strlen(sc->sc_name) + 2); |
env = xrealloc(env, len); |
env[len] = CNULL; |
(void) strlcat(env, "';", len); |
if (*(p = &env[len - 1]) == ':') |
(void) strlcat(env, sc->sc_name, len); |
*p = CNULL; |
|
(void) strcat(env, "';"); |
|
(void) strcat(env, sc->sc_name); |
|
message(MT_CHANGE, "cmdspecial \"%s\"", env); |
message(MT_CHANGE, "cmdspecial \"%s\"", env); |
if (!nflag && IS_OFF(options, DO_VERIFY)) |
if (!nflag && IS_OFF(options, DO_VERIFY)) |
runcommand(env); |
runcommand(env); |