]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
Make volscan's column delimiter option work
authorPaul Smeddle <paul.smeddle@morganstanley.com>
Mon, 12 Mar 2012 19:56:11 +0000 (19:56 +0000)
committerStephan Wiesand <stephan.wiesand@desy.de>
Wed, 13 Aug 2014 18:34:02 +0000 (14:34 -0400)
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 <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
(cherry picked from commit d62456255e13beef41770ad90ee6cb58068007b9)

Change-Id: Ic5e253c2c1ae6fcdba79b70bf43ba16883389ccd
Reviewed-on: http://gerrit.openafs.org/11271
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/vol/vol-info.c

index 96194ba6bee1697f6086ac050f8637e5fd3230f0..9314ab4280703e8a6fbbcbc28aa5a125bd5b145c 100644 (file)
@@ -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) {