diff -u -r boxes-SNAP-20000401.orig/src/boxes.c boxes-SNAP-20000401/src/boxes.c --- boxes-SNAP-20000401.orig/src/boxes.c Sat Apr 1 20:33:32 2000 +++ boxes-SNAP-20000401/src/boxes.c Fri Jun 16 17:07:20 2000 @@ -302,6 +302,7 @@ fprintf (st, " -r remove box from input\n"); fprintf (st, " -s wxh specify box size (width w and/or height h)\n"); fprintf (st, " -t uint set tab stop distance [default: %d]\n", DEF_TABSTOP); + fprintf (st, " -u unexpand tab stops\n"); fprintf (st, " -v print version information\n"); } @@ -529,7 +530,7 @@ * Parse Command Line */ do { - oc = getopt (argc, argv, "a:c:d:f:hi:k:lp:rs:t:v"); + oc = getopt (argc, argv, "a:c:d:f:hi:k:lp:rs:t:uv"); switch (oc) { @@ -822,6 +823,13 @@ } opt.tabstop = idummy; break; + + case 'u': + /* + * Unexpand tab stops + */ + opt.unexpand = 1; + break; case 'v': /* diff -u -r boxes-SNAP-20000401.orig/src/boxes.h.in boxes-SNAP-20000401/src/boxes.h.in --- boxes-SNAP-20000401.orig/src/boxes.h.in Sat Apr 1 20:33:33 2000 +++ boxes-SNAP-20000401/src/boxes.h.in Fri Jun 16 17:35:54 2000 @@ -199,6 +199,7 @@ int l; /* list available designs */ int r; /* remove box from input */ int tabstop; /* tab stop distance */ + int unexpand; /* unexpand tab stops */ int padding[ANZ_SIDES]; /* in spaces or lines resp. */ design_t *design; /* currently used box design */ int design_choice_by_user; /* true if design was chosen by user */ diff -u -r boxes-SNAP-20000401.orig/src/generate.c boxes-SNAP-20000401/src/generate.c --- boxes-SNAP-20000401.orig/src/generate.c Sat Apr 1 20:33:33 2000 +++ boxes-SNAP-20000401/src/generate.c Fri Jun 16 16:59:56 2000 @@ -862,6 +862,7 @@ size_t nol = thebox[BRIG].height; /* number of output lines */ char trailspc[LINE_MAX+1]; char *indentspc; + int indentspclen; size_t vfill, vfill1, vfill2; /* empty lines/columns in box */ size_t hfill; char *hfill1, *hfill2; /* space before/after text */ @@ -873,6 +874,7 @@ size_t skip_start; /* lines to skip for box top */ size_t skip_end; /* lines to skip for box bottom */ size_t skip_left; /* true if left box part is to be skipped */ + int ntabs, nspcs; /* needed for unexpand of tabs */ #ifdef DEBUG fprintf (stderr, "Padding used: left %d, top %d, right %d, bottom %d\n", @@ -884,13 +886,27 @@ * Create string of spaces for indentation */ if (opt.design->indentmode == 'b') { - indentspc = (char *) malloc (input.indent+1); + if (opt.unexpand) { + ntabs = input.indent / opt.tabstop; + nspcs = input.indent % opt.tabstop; + indentspclen = ntabs+nspcs; + } + else { + indentspclen = input.indent; + } + indentspc = (char *) malloc (indentspclen+1); if (indentspc == NULL) { perror (PROJECT); return 1; } - memset (indentspc, (int)' ', input.indent); - indentspc[input.indent] = '\0'; + if (opt.unexpand) { + memset (indentspc, (int)'\t', ntabs); + memset (indentspc+ntabs, (int)' ', nspcs); + } + else { + memset (indentspc, (int)' ', indentspclen); + } + indentspc[indentspclen] = '\0'; } else { indentspc = (char *) strdup (""); diff -u -r boxes-SNAP-20000401.orig/src/remove.c boxes-SNAP-20000401/src/remove.c --- boxes-SNAP-20000401.orig/src/remove.c Sat Apr 1 20:33:33 2000 +++ boxes-SNAP-20000401/src/remove.c Fri Jun 16 17:17:03 2000 @@ -1049,11 +1049,31 @@ */ { size_t j; + size_t indent; + char *indentspc; + int ntabs, nspcs; for (j=0; j