Here's my patch, based on your idea.
--
Paul Martin <[email protected]>
Index: logrotate-3.7.8/config.c
===================================================================
--- logrotate-3.7.8.orig/config.c 2010-03-15 15:52:12.146006930 +0000
+++ logrotate-3.7.8/config.c 2010-03-15 15:49:24.748007001 +0000
@@ -575,8 +575,28 @@
return 1;
} else if (*start == '\n') {
lineNum++;
+ while (isblank(*start) && (*start))
+ start++;
+ } else if (
+ (strncmp(start, "postrotate", 10) == 0) ||
+ (strncmp(start, "prerotate", 9) == 0) ||
+ (strncmp(start, "firstrotate", 11) == 0) ||
+ (strncmp(start, "lastrotate", 10) == 0)
+ )
+ {
+ while (*start) {
+ while ((*start != '\n') && (*start))
+ start++;
+ lineNum++;
+ while (isblank(*start) && (*start))
+ start++;
+ if (strncmp(start, "endscript", 9) == 0) {
+ start += 9;
+ break;
+ }
+ } else {
+ start++;
}
- start++;
}
start++;