mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fixed a bug in pager, + added a feature to it.
This commit is contained in:
@@ -1 +1 @@
|
|||||||
heikki@donna.mysql.fi
|
jani@hynda.mysql.fi
|
||||||
|
@@ -39,7 +39,7 @@
|
|||||||
#include "my_readline.h"
|
#include "my_readline.h"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
const char *VER="11.13";
|
const char *VER="11.14";
|
||||||
|
|
||||||
/* Don't try to make a nice table if the data is too big */
|
/* Don't try to make a nice table if the data is too big */
|
||||||
#define MAX_COLUMN_LENGTH 1024
|
#define MAX_COLUMN_LENGTH 1024
|
||||||
@@ -592,7 +592,16 @@ static int get_options(int argc, char **argv)
|
|||||||
if (optarg)
|
if (optarg)
|
||||||
strmov(pager, optarg);
|
strmov(pager, optarg);
|
||||||
else
|
else
|
||||||
strmov(pager, (char*) getenv("PAGER"));
|
{
|
||||||
|
char *pagpoint = getenv("PAGER");
|
||||||
|
if (!((char*) (pagpoint)))
|
||||||
|
{
|
||||||
|
strmov(pager, "stdout");
|
||||||
|
opt_nopager=1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
strmov(pager, pagpoint);
|
||||||
|
}
|
||||||
strmov(default_pager, pager);
|
strmov(default_pager, pager);
|
||||||
break;
|
break;
|
||||||
case OPT_NOPAGER:
|
case OPT_NOPAGER:
|
||||||
@@ -1823,6 +1832,7 @@ com_pager(String *buffer, char *line __attribute__((unused)))
|
|||||||
end--;
|
end--;
|
||||||
end[0]=0;
|
end[0]=0;
|
||||||
strmov(pager, pager_name);
|
strmov(pager, pager_name);
|
||||||
|
strmov(default_pager, pager_name);
|
||||||
}
|
}
|
||||||
opt_nopager=0;
|
opt_nopager=0;
|
||||||
tee_fprintf(stdout, "PAGER set to %s\n", pager);
|
tee_fprintf(stdout, "PAGER set to %s\n", pager);
|
||||||
|
Reference in New Issue
Block a user