mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-22 17:23:03 +02:00
Compare commits
3 Commits
54e788b765
...
a933c8bc69
| Author | SHA1 | Date | |
|---|---|---|---|
| a933c8bc69 | |||
| 087fbfd8e6 | |||
| ff641d7990 |
+11
-9
@@ -14,11 +14,12 @@ If \fIfilename\fR is specified as a single dash '-', then \fBRemind\fR
|
||||
takes its input from standard input.
|
||||
|
||||
.PP
|
||||
If \fIfilename\fR happens to
|
||||
be a directory rather than a plain file, then \fBRemind\fR reads all of
|
||||
the files in that directory that match the pattern "*.rem". The files
|
||||
are read in sorted order; the sort order may depend on your locale, but
|
||||
should match the sort order used by the shell to expand "*.rem".
|
||||
If \fIfilename\fR happens to be a directory rather than a plain file,
|
||||
then \fBRemind\fR reads all of the files (but not any subdirectories!)
|
||||
in that directory that match the pattern "*.rem". The files are read
|
||||
in sorted order; the sort order may depend on your locale, but should
|
||||
match the sort order used by the shell to expand "*.rem".
|
||||
|
||||
.PP
|
||||
\fBRemind\fR reads its files starting from the beginning to the end, or
|
||||
until it encounters a line whose sole content is "__EOF__" (without the quotes.)
|
||||
@@ -1925,10 +1926,11 @@ administrator.)
|
||||
If you specify a filename of "-" in the \fBINCLUDE\fR command, \fBRemind\fR
|
||||
will begin reading from standard input.
|
||||
.PP
|
||||
If you specify a \fIdirectory\fR as the argument to \fBINCLUDE\fR, then
|
||||
\fBRemind\fR will process all files in that directory that match the shell
|
||||
pattern "*.rem". The files are processed in sorted order; the sort order
|
||||
matches that used by the shell when it expands "*.rem".
|
||||
If you specify a \fIdirectory\fR as the argument to \fBINCLUDE\fR,
|
||||
then \fBRemind\fR will process all files (but not subdirectories!) in
|
||||
that directory that match the shell pattern "*.rem". The files are
|
||||
processed in sorted order; the sort order matches that used by the
|
||||
shell when it expands "*.rem".
|
||||
.PP
|
||||
Note that the file specified by an \fBINCLUDE\fR command is interpreted
|
||||
relative to the \fIcurrent working directory of the Remind process\fR.
|
||||
|
||||
+18
-2
@@ -726,6 +726,8 @@ static int SetupGlobChain(char const *dirname, IncludeStruct *i)
|
||||
size_t l;
|
||||
int r;
|
||||
glob_t glob_buf;
|
||||
struct stat sb;
|
||||
|
||||
DirectoryFilenameChain *dc = CachedDirectoryChains;
|
||||
|
||||
i->chain = NULL;
|
||||
@@ -808,6 +810,16 @@ static int SetupGlobChain(char const *dirname, IncludeStruct *i)
|
||||
|
||||
/* Add the files to the chain backwards to preserve sort order */
|
||||
for (r=glob_buf.gl_pathc-1; r>=0; r--) {
|
||||
if (stat(glob_buf.gl_pathv[r], &sb) < 0) {
|
||||
/* Couldn't stat the file... fuggedaboutit */
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Don't add directories */
|
||||
if (S_ISDIR(sb.st_mode)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
FilenameChain *ch = malloc(sizeof(FilenameChain));
|
||||
if (!ch) {
|
||||
globfree(&glob_buf);
|
||||
@@ -816,8 +828,6 @@ static int SetupGlobChain(char const *dirname, IncludeStruct *i)
|
||||
return E_NO_MEM;
|
||||
}
|
||||
|
||||
/* TODO: stat the file and only add if it's a plain file and
|
||||
readable by us */
|
||||
ch->filename = StrDup(glob_buf.gl_pathv[r]);
|
||||
if (!ch->filename) {
|
||||
globfree(&glob_buf);
|
||||
@@ -1149,6 +1159,12 @@ static int CheckSafety(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (S_ISDIR(statbuf.st_mode)) {
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!CheckSafetyAux(&statbuf)) {
|
||||
fclose(fp);
|
||||
fp = NULL;
|
||||
|
||||
Reference in New Issue
Block a user