From d62456255e13beef41770ad90ee6cb58068007b9 Mon Sep 17 00:00:00 2001 From: Paul Smeddle Date: Mon, 12 Mar 2012 19:56:11 +0000 Subject: [PATCH] Make volscan's column delimiter option work Currently, volscan ignores the -delim command-line option, using the hardcoded default. This patch adds processing for this option, allowing alternative characters. Corrects an error in a08c3207255756c825ab69a19e04f79dd879c646 Change-Id: I750f2d998cff029fc02556ed0baaaa0ca1c95e08 Reviewed-on: http://gerrit.openafs.org/6894 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/vol/vol-info.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/vol/vol-info.c b/src/vol/vol-info.c index e73ac4ea0..83a332082 100644 --- a/src/vol/vol-info.c +++ b/src/vol/vol-info.c @@ -185,7 +185,7 @@ static int SaveInodes = 0; /**< Save vnode data to files */ static int FixHeader = 0; /**< Repair header files magic and version fields. */ static char Hostname[64] = ""; /**< This hostname, for volscan output. */ static int NeedDirIndex = 0; /**< Large vnode index handle is needed for path lookups. */ -static char *ColumnDelim = " "; /**< Column delimiter char(s) */ +static char ColumnDelim[16] = " "; /**< Column delimiter char(s) */ static char PrintHeading = 0; /**< Print column heading */ static unsigned int ModeMask[64]; @@ -931,6 +931,10 @@ VolScan(struct cmd_syndesc *as, void *arock) } else { PrintHeading = 1; } + if ((ti = as->parms[P_DELIM].items)) { + strncpy(ColumnDelim, ti->data, 15); + ColumnDelim[15] = '\0'; + } /* Limit types of volumes to scan. */ if (!as->parms[P_TYPE].items) { -- 2.39.5