From 548bf497a7baf02b0a85e7673eb525034e352f47 Mon Sep 17 00:00:00 2001 From: Myles Watson Date: Mon, 25 Feb 2008 16:06:36 +0000 Subject: [PATCH] This is a simple patch which corrects directory handling for add (makes it the same as create.) Without this patch you can create a lar and recursively add a directory to it, but you can't add one with add. Another patch might be to make lar -l print something when you use the directory option, but I'm not sure what was intended originally. Myles Signed-off-by: Myles Watson Acked-by: Peter Stuge git-svn-id: svn://coreboot.org/repository/coreboot-v3@618 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- util/lar/lar.c | 6 +++--- util/lar/lib.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/util/lar/lar.c b/util/lar/lar.c index 1a03d9129f..fd8c942658 100644 --- a/util/lar/lar.c +++ b/util/lar/lar.c @@ -370,13 +370,13 @@ int main(int argc, char *argv[]) exit(1); } - /* when a new archive is created, recurse over - * physical files when a directory is found. + /* when a new archive is created or added to, recurse over + * the physical files when a directory is found. * Otherwise just add the directory to the match list */ while (optind < argc) { - if (larmode == CREATE) { + if (larmode == CREATE || larmode == ADD) { add_files(argv[optind++]); } else add_file_or_directory(argv[optind++]); diff --git a/util/lar/lib.c b/util/lar/lib.c index 0dd2a69663..fd6154fc3e 100644 --- a/util/lar/lib.c +++ b/util/lar/lib.c @@ -223,7 +223,7 @@ static int handle_directory(const char *name) /* * Add physically existing files to the file list. - * This function is used when an archive is created. + * This function is used when an archive is created or added to. */ int add_files(const char *name)