summaryrefslogtreecommitdiff
path: root/print-token.c
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2020-06-13 00:08:49 -0700
committerGuy Harris <gharris@sonic.net>2020-06-13 00:08:49 -0700
commitf28d5b06872ae9ab7dd9216f9cd56cba1ec7178b (patch)
treeb83e75cf0dfa60dbf210e3ddd4fd22f8b9137c83 /print-token.c
parent27ede6609cad295a3100fe7c11fca35192da8d74 (diff)
downloadtcpdump-f28d5b06872ae9ab7dd9216f9cd56cba1ec7178b.tar.gz
TESTrun: clean up printing of files.
Many Windows commands only accept paths using backslashes, because slashes are option separators. Add a showfile() function that takes a pathname as an argument and: on Windows, converts the pathname to canonical form - which means any slashes will be converted to backslashes - and run "type" on it; on UN*X, run "cat" on it. Convert cat foo | diff bar - to diff bar foo to avoid using cat at all. (Note also that the closest built-in Windows equivalent of diff, fc, does *not* support reading the standard input as one of the files to compare, so it also will avoid that when we change those to use fc on Windows.) The one remaining use of cat is in a command with pathnames, so use a type command, with backslash-separated paths, on Windows, and cat, with slash-separated paths, on UN*X. We might just want to do that directly in Perl; add a comment about that.
Diffstat (limited to 'print-token.c')
0 files changed, 0 insertions, 0 deletions