summaryrefslogtreecommitdiff
path: root/build/files.c
diff options
context:
space:
mode:
authorroot <devnull@localhost>1996-07-23 20:58:09 +0000
committerroot <devnull@localhost>1996-07-23 20:58:09 +0000
commit5c0e47c6bd20c6dd16cefb2f05b56a856dbc1d3d (patch)
treeebefaf9031c95b571fd17318747e94ace36e085d /build/files.c
parent4441898dd062d74e15e51c1314477fbf30ff6196 (diff)
downloadlibrpm-tizen-5c0e47c6bd20c6dd16cefb2f05b56a856dbc1d3d.tar.gz
librpm-tizen-5c0e47c6bd20c6dd16cefb2f05b56a856dbc1d3d.tar.bz2
librpm-tizen-5c0e47c6bd20c6dd16cefb2f05b56a856dbc1d3d.zip
do some sanity checking on the file list
- only one file listed per line - barf on any files that don't start with "/" CVS patchset: 926 CVS date: 1996/07/23 20:58:09
Diffstat (limited to 'build/files.c')
-rw-r--r--build/files.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/build/files.c b/build/files.c
index 18096c7df..57543e33c 100644
--- a/build/files.c
+++ b/build/files.c
@@ -146,9 +146,21 @@ int process_filelist(Header header, struct PackageRec *pr,
} else if (!strcmp(s, "%dir")) {
isdir = 1;
} else {
- if (isdoc && (*s != '/')) {
- /* This is a special %doc macro */
- special_doc = 1;
+ if (filename) {
+ /* We already got a file -- error */
+ error(RPMERR_BADSPEC,
+ "Two files on one line: %s", filename);
+ return(RPMERR_BADSPEC);
+ }
+ if (*s != '/') {
+ if (isdoc) {
+ special_doc = 1;
+ } else {
+ /* not in %doc, does not begin with / -- error */
+ error(RPMERR_BADSPEC,
+ "File must begin with \"/\": %s", s);
+ return(RPMERR_BADSPEC);
+ }
} else {
filename = s;
}