From ad73f6b86fbd09800ecc8ea4d1b173a8e655cdb7 Mon Sep 17 00:00:00 2001 From: Bruce Momjian Date: Fri, 25 Jul 2003 21:48:45 +0000 Subject: [PATCH] Update copyrights to 2003. print.c: Add one more line to pager calculation to account for the prompt. help.c: Call PageOutput with correct number of lines within slashUsage Add one to line count in helpSQL to account for "Available help:" line. Make copyright match COPYRIGHT file. (Just "1994") Greg Sabino Mullane --- src/bin/psql/help.c | 12 ++++++------ src/bin/psql/print.c | 8 +++++--- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c index eb02dd58ad..a884beb2e6 100644 --- a/src/bin/psql/help.c +++ b/src/bin/psql/help.c @@ -1,9 +1,9 @@ /* * psql - the PostgreSQL interactive terminal * - * Copyright 2000 by PostgreSQL Global Development Group + * Copyright 2000-2003 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.74 2003/07/23 08:47:39 petere Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/help.c,v 1.75 2003/07/25 21:48:45 momjian Exp $ */ #include "postgres_fe.h" #include "common.h" @@ -163,7 +163,7 @@ slashUsage(unsigned short int pager) { FILE *output; - output = PageOutput(50, pager); + output = PageOutput(64, pager); /* if you add/remove a line here, change the row count above */ @@ -276,7 +276,7 @@ helpSQL(const char *topic, unsigned short int pager) int items_per_column = (QL_HELP_COUNT + 2) / 3; FILE *output; - output = PageOutput(items_per_column, pager); + output = PageOutput(items_per_column + 1, pager); fputs(_("Available help:\n"), output); @@ -338,10 +338,10 @@ print_copyright(void) { puts( "PostgreSQL Data Base Management System\n\n" - "Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group\n\n" + "Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group\n\n" "This software is based on Postgres95, formerly known as Postgres, which\n" "contains the following notice:\n\n" - "Portions Copyright(c) 1994 - 7 Regents of the University of California\n\n" + "Portions Copyright(c) 1994, Regents of the University of California\n\n" "Permission to use, copy, modify, and distribute this software and its\n" "documentation for any purpose, without fee, and without a written agreement\n" "is hereby granted, provided that the above copyright notice and this paragraph\n" diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c index 794953716b..2f71aad9bc 100644 --- a/src/bin/psql/print.c +++ b/src/bin/psql/print.c @@ -1,9 +1,9 @@ /* * psql - the PostgreSQL interactive terminal * - * Copyright 2000 by PostgreSQL Global Development Group + * Copyright 2000-2003 by PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.39 2003/06/12 08:15:28 momjian Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/print.c,v 1.40 2003/07/25 21:48:45 momjian Exp $ */ #include "postgres_fe.h" #include "common.h" @@ -1004,7 +1004,9 @@ PageOutput(int lines, unsigned short int pager) struct winsize screen_size; result = ioctl(fileno(stdout), TIOCGWINSZ, &screen_size); - if (result == -1 || lines > screen_size.ws_row || pager > 1) + + /* >= accounts for a one-line prompt */ + if (result == -1 || lines >= screen_size.ws_row || pager > 1) { #endif pagerprog = getenv("PAGER");