summaryrefslogtreecommitdiff
path: root/src/local.mk
diff options
context:
space:
mode:
authorAssaf Gordon <assafgordon@gmail.com>2016-06-24 21:48:29 -0400
committerPádraig Brady <P@draigBrady.com>2016-08-09 11:31:00 +0100
commitff2178bf30e3eda566cc1d1670768c6d6694a8ac (patch)
treee8e7c34c1250f671ca3b700799e96b428348138a /src/local.mk
parent1c17f61ef993a5ee5fb0d3bc47b7b25782ae386c (diff)
downloadcoreutils-ff2178bf30e3eda566cc1d1670768c6d6694a8ac.tar.gz
maint: refactor common expand(1) and unexpand(1) code
* src/expand.c, src/unexpand.c: Move global variables from here... * src/expand-common.h, src/expand-common.c: ... to here. * src/expand.c, src/unexpand.c: (parse_tab_stops, validate_tab_stops, next_file): Move identical functions to new module. (add_tab_stop): Move to new module, including additional code from 'unexpand' (keeping max_column_width) which will have no effect in when used in 'expand'. Refactor common next-column calculation code into a new function 'get_next_tab_column'. * src/local.mk: (src_expand_SOURCES, src_unexpand_SOURCES): Add 'expand-common.c'; (noinst_HEADERS): Add 'expand-common.h'. * po/POTFILES.in: Add 'expand-common.c'. * tests/misc/expand.pl: Add more tests. * tests/misc/unexpand.pl: Likewise. * TODO: Move conclusions to above test after investigation.
Diffstat (limited to 'src/local.mk')
-rw-r--r--src/local.mk4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/local.mk b/src/local.mk
index 12a0d55d4..6afaf836a 100644
--- a/src/local.mk
+++ b/src/local.mk
@@ -44,6 +44,7 @@ noinst_HEADERS = \
src/copy.h \
src/cp-hash.h \
src/dircolors.h \
+ src/expand-common.h \
src/fiemap.h \
src/find-mount-point.h \
src/fs.h \
@@ -408,6 +409,9 @@ src_base32_CPPFLAGS = -DBASE_TYPE=32 $(AM_CPPFLAGS)
src_ginstall_CPPFLAGS = -DENABLE_MATCHPATHCON=1 $(AM_CPPFLAGS)
+src_expand_SOURCES = src/expand.c src/expand-common.c
+src_unexpand_SOURCES = src/unexpand.c src/expand-common.c
+
# Ensure we don't link against libcoreutils.a as that lib is
# not compiled with -fPIC which causes issues on 64 bit at least
src_libstdbuf_so_LDADD = $(LIBINTL)