X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=index%2Ftrav.c;h=4ac362934541e754af0b58da2628c3416b6e9b27;hb=94134a7a5eff3cea5c2971836f7da89ac7ba7791;hp=4ea6fb65271d8ad96a721e5b76630f2b9991b768;hpb=dd5f8f31bc5018a7b4a00accdda256ce1eaef14b;p=idzebra-moved-to-github.git diff --git a/index/trav.c b/index/trav.c index 4ea6fb6..4ac3629 100644 --- a/index/trav.c +++ b/index/trav.c @@ -4,7 +4,12 @@ * Sebastian Hammer, Adam Dickmeiss * * $Log: trav.c,v $ - * Revision 1.11 1995-11-22 17:19:19 adam + * Revision 1.12 1995-11-24 11:31:37 adam + * Commands add & del read filenames from stdin if source directory is + * empty. + * Match criteria supports 'constant' strings. + * + * Revision 1.11 1995/11/22 17:19:19 adam * Record management uses the bfile system. * * Revision 1.10 1995/11/21 15:01:16 adam @@ -90,6 +95,14 @@ static void repositoryExtractR (int deleteFlag, char *rep, } +static void stdinExtractR (int deleteFlag, struct recordGroup *rGroup) +{ + char tmppath[256]; + + while (scanf ("%s", tmppath) == 1) + fileExtract (NULL, tmppath, rGroup, deleteFlag); +} + static void repositoryUpdateR (struct dirs_info *di, struct dirs_entry *dst, const char *base, char *src, struct recordGroup *rGroup) @@ -230,7 +243,10 @@ void repositoryDelete (struct recordGroup *rGroup) assert (rGroup->path); strcpy (src, rGroup->path); - repositoryExtractR (1, src, rGroup); + if (*src == '\0') + stdinExtractR (1, rGroup); + else + repositoryExtractR (1, src, rGroup); } void repositoryAdd (struct recordGroup *rGroup) @@ -239,6 +255,9 @@ void repositoryAdd (struct recordGroup *rGroup) assert (rGroup->path); strcpy (src, rGroup->path); - repositoryExtractR (0, src, rGroup); + if (*src == '\0') + stdinExtractR (0, rGroup); + else + repositoryExtractR (0, src, rGroup); }