From 188803394908f222ab3ed8ec32331eb6dd00fd2d Mon Sep 17 00:00:00 2001 From: rgrimes Date: Tue, 30 May 1995 00:07:29 +0000 Subject: Remove trailing whitespace. Reviewed by: phk --- bin/ed/main.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'bin/ed/main.c') diff --git a/bin/ed/main.c b/bin/ed/main.c index d43efad..01f30e5 100644 --- a/bin/ed/main.c +++ b/bin/ed/main.c @@ -25,7 +25,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: main.c,v 1.3 1994/09/24 02:55:28 davidg Exp $ + * $Id: main.c,v 1.4 1995/03/19 13:28:34 joerg Exp $ */ #ifndef lint @@ -42,7 +42,7 @@ static char *rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp"; * CREDITS * * This program is based on the editor algorithm described in - * Brian W. Kernighan and P. J. Plauger's book "Software Tools + * Brian W. Kernighan and P. J. Plauger's book "Software Tools * in Pascal," Addison-Wesley, 1981. * * The buffering algorithm is attributed to Rodney Ruddock of @@ -192,7 +192,7 @@ top: fputs("?\n", stderr); sprintf(errmsg, "warning: file modified"); if (!isatty(0)) { - fprintf(stderr, garrulous ? + fprintf(stderr, garrulous ? "script, line %d: %s\n" : "", lineno, errmsg); quit(2); @@ -213,7 +213,7 @@ top: isglobal = 0; if ((status = extract_addr_range()) >= 0 && (status = exec_command()) >= 0) - if (!status || + if (!status || (status = display_lines(current_addr, current_addr, status)) >= 0) continue; @@ -225,16 +225,16 @@ top: fputs("?\n", stderr); /* give warning */ sprintf(errmsg, "warning: file modified"); if (!isatty(0)) { - fprintf(stderr, garrulous ? - "script, line %d: %s\n" : + fprintf(stderr, garrulous ? + "script, line %d: %s\n" : "", lineno, errmsg); quit(2); } break; case FATAL: if (!isatty(0)) - fprintf(stderr, garrulous ? - "script, line %d: %s\n" : "", + fprintf(stderr, garrulous ? + "script, line %d: %s\n" : "", lineno, errmsg); else fprintf(stderr, garrulous ? "%s\n" : "", @@ -243,7 +243,7 @@ top: default: fputs("?\n", stderr); if (!isatty(0)) { - fprintf(stderr, garrulous ? + fprintf(stderr, garrulous ? "script, line %d: %s\n" : "", lineno, errmsg); quit(2); @@ -256,7 +256,7 @@ top: long first_addr, second_addr, addr_cnt; -/* extract_addr_range: get line addresses from the command buffer until an +/* extract_addr_range: get line addresses from the command buffer until an illegal address is seen; return status */ int extract_addr_range() @@ -548,7 +548,7 @@ exec_command() GET_COMMAND_SUFFIX(); isglobal++; if (exec_global(n, gflag) < 0) - return ERR; + return ERR; break; case 'h': if (addr_cnt > 0) { @@ -691,7 +691,7 @@ exec_command() sflags |= SGR; ibufp++; break; - case '0': case '1': case '2': case '3': case '4': + case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': STRTOL(sgnum, ibufp); sflags |= SGF; @@ -802,7 +802,7 @@ exec_command() return ERR; } #endif - if ((addr = write_file(*fnp ? fnp : old_filename, + if ((addr = write_file(*fnp ? fnp : old_filename, (c == 'W') ? "a" : "w", first_addr, second_addr)) < 0) return ERR; else if (addr == addr_last) @@ -888,7 +888,7 @@ check_addr_range(n, m) } -/* get_matching_node_addr: return the address of the next line matching a +/* get_matching_node_addr: return the address of the next line matching a pattern in a given direction. wrap around begin/end of editor buffer if necessary */ long @@ -1148,7 +1148,7 @@ move_lines(addr) REQUE(b2, b1->q_forw); REQUE(a1->q_back, a2); REQUE(b1, a1); - current_addr = addr + ((addr < first_addr) ? + current_addr = addr + ((addr < first_addr) ? second_addr - first_addr + 1 : 0); } if (isglobal) -- cgit v1.1