X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Ftset.c;h=2ee9c1190ba0aff9c7f0d8590ef27c757b6540d0;hp=1a963bcd16aa9e5ccf94cf8aa0ad2ae7fc976117;hb=a108bc76f220a81a223a5c25f59195af60452128;hpb=cba932f979e14e49b63e06715e80f64d9ffe6e5e diff --git a/progs/tset.c b/progs/tset.c index 1a963bcd..2ee9c119 100644 --- a/progs/tset.c +++ b/progs/tset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -119,7 +119,7 @@ char *ttyname(int fd); #include #include -MODULE_ID("$Id: tset.c,v 1.85 2011/12/10 15:41:34 tom Exp $") +MODULE_ID("$Id: tset.c,v 1.87 2012/01/21 23:55:05 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -1050,11 +1050,18 @@ set_tabs(void) { if (set_tab && clear_all_tabs) { int c; + int lim = +#if HAVE_SIZECHANGE + tcolumns +#else + columns +#endif + ; (void) putc('\r', stderr); /* Force to left margin. */ tputs(clear_all_tabs, 0, outc); - for (c = 8; c < tcolumns; c += 8) { + for (c = 8; c < lim; c += 8) { /* Get to the right column. In BSD tset, this * used to try a bunch of half-clever things * with cup and hpa, for an average saving of