From e7826e491d15ff334c8bb1d572a471d37d3284d2 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 Reviewed-on: http://gerrit.openafs.org/6894 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman (cherry picked from commit d62456255e13beef41770ad90ee6cb58068007b9) Change-Id: Ic5e253c2c1ae6fcdba79b70bf43ba16883389ccd Reviewed-on: http://gerrit.openafs.org/11271 Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand --- 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 96194ba6b..9314ab428 100644 --- a/src/vol/vol-info.c +++ b/src/vol/vol-info.c @@ -213,7 +213,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]; @@ -959,6 +959,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