]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit - db/init.c
xfs_db: fix the 'source' command when passed as a -c option
authorDarrick J. Wong <darrick.wong@oracle.com>
Thu, 26 Jan 2017 02:02:43 +0000 (20:02 -0600)
committerEric Sandeen <sandeen@redhat.com>
Thu, 26 Jan 2017 02:02:43 +0000 (20:02 -0600)
commitc8dc4235614292020f82a031545d66c000b455f9
tree8f2beb34ffe9c102af3a02a7e757a0e78398206f
parenta547152d47909aba27336a1d1d42fccf96262476
xfs_db: fix the 'source' command when passed as a -c option

The 'source' command is supposed to read commands out of a file and
execute them.  This works great when done from an interactive command
line, but it doesn't work at all when invoked from the command line
because we never actually do anything with the opened file.

So don't load stdin into the input stack when we're only executing
command line options, and use that to decide if source_f is executing
from the command line so that we can actually run the input loop.  We'll
use this for the per-field fuzzing xfstests.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
db/init.c
db/input.c