fixed cleanup and lbash example

This commit is contained in:
Axel Kittenberger 2010-11-29 16:38:31 +00:00
parent 0656296463
commit b73bbe3287
2 changed files with 11 additions and 5 deletions

View File

@ -26,8 +26,13 @@ bash = {
maxProcesses = 1,
-- calls `cp -r SOURCE/* TARGET` only when there is something in SOURCE
onStartup =
[[if [ "$(ls -A ^source)" ]; then cp -r ^source* ^target; fi]],
-- otherwise it deletes contents in the target if there.
onStartup = [[
if [ "$(ls -A ^source)" ]; then
cp -r ^source* ^target;
else
if [ "$(ls -A ^target)" ]; then rm -rf ^target/*; fi
fi]],
onCreate = prefix..[[cp -r ^sourcePath ^targetPathdir]],

View File

@ -1660,12 +1660,13 @@ main1(int argc, char *argv[])
int ci;
struct logcat *lc;
for(ci = 'A'; ci <= 'Z'; ci++) {
for(lc = logcats[ci]; lc && lc->name; lc++) {
for(lc = logcats[ci - 'A']; lc && lc->name; lc++) {
free(lc->name);
lc->name = NULL;
}
if (logcats[ci]) {
free(logcats[ci]);
if (logcats[ci - 'A']) {
free(logcats[ci - 'A']);
logcats[ci - 'A'] = NULL;
}
}
}