diff options
author | midipix <writeonce@midipix.org> | 2016-01-02 12:11:47 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-01-02 12:11:47 -0500 |
commit | 5590ea75cc108ae620a47c072fcbd95c1dc74add (patch) | |
tree | 4a9af464087f6fc7487f4edfda11274f09244817 /src/output | |
parent | 6adb90fd75f544895ba8ffc960f08ff00dc58949 (diff) | |
download | apimagic-5590ea75cc108ae620a47c072fcbd95c1dc74add.tar.bz2 apimagic-5590ea75cc108ae620a47c072fcbd95c1dc74add.tar.xz |
amgc_output_pad_symbol(): increase symwidth to match the next tab stop.
Diffstat (limited to 'src/output')
-rw-r--r-- | src/output/amgc_output_pad_symbol.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/output/amgc_output_pad_symbol.c b/src/output/amgc_output_pad_symbol.c index ea10204..6a475ee 100644 --- a/src/output/amgc_output_pad_symbol.c +++ b/src/output/amgc_output_pad_symbol.c @@ -8,6 +8,7 @@ #include <string.h> #include <apimagic/apimagic.h> +#include "apimagic_driver_impl.h" int amgc_output_pad_symbol( const char * symbol, @@ -15,10 +16,19 @@ int amgc_output_pad_symbol( FILE * fout) { int len = (int)(strlen(symbol)); + int symwidth = layout->symwidth; if (layout->symwidth < 1) return -1; + if (layout->tabwidth) { + symwidth += layout->tabwidth; + symwidth &= (~(layout->tabwidth-1)); + } else { + symwidth += AMGC_TAB_WIDTH; + symwidth &= (~(AMGC_TAB_WIDTH-1)); + } + if (layout->tabwidth == 0) return fprintf(fout,"%*c",layout->symwidth-len,' '); |