mirror of
https://github.com/moparisthebest/pacman
synced 2024-08-13 17:03:46 -04:00
Cleanup 'neednl' usage - make it static
This commit is contained in:
parent
170d63190a
commit
7f465320e4
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
extern config_t *config;
|
extern config_t *config;
|
||||||
|
|
||||||
int neednl = 0; /* for cleaner message output */
|
static int neednl = 0; /* for cleaner message output */
|
||||||
static int needpad = 0; /* pad blanks to terminal width */
|
static int needpad = 0; /* pad blanks to terminal width */
|
||||||
|
|
||||||
/* simple helper for needpad */
|
/* simple helper for needpad */
|
||||||
|
@ -78,8 +78,6 @@ pmdb_t *db_local;
|
|||||||
/* list of targets specified on command line */
|
/* list of targets specified on command line */
|
||||||
static alpm_list_t *pm_targets;
|
static alpm_list_t *pm_targets;
|
||||||
|
|
||||||
extern int neednl;
|
|
||||||
|
|
||||||
/* Display usage/syntax for the specified operation.
|
/* Display usage/syntax for the specified operation.
|
||||||
* op: the operation code requested
|
* op: the operation code requested
|
||||||
* myname: basename(argv[0])
|
* myname: basename(argv[0])
|
||||||
@ -197,14 +195,8 @@ static void cleanup(int signum)
|
|||||||
FREELIST(pm_targets);
|
FREELIST(pm_targets);
|
||||||
FREECONF(config);
|
FREECONF(config);
|
||||||
|
|
||||||
if(neednl) {
|
/* This fixes up any missing newlines (neednl) */
|
||||||
putchar('\n');
|
MSG(NL, "");
|
||||||
}
|
|
||||||
|
|
||||||
/* restore the cursor
|
|
||||||
printf("\033[?25h\033[?0c");
|
|
||||||
fflush(stdout);
|
|
||||||
*/
|
|
||||||
|
|
||||||
exit(signum);
|
exit(signum);
|
||||||
}
|
}
|
||||||
@ -407,10 +399,6 @@ int main(int argc, char *argv[])
|
|||||||
signal(SIGTERM, cleanup);
|
signal(SIGTERM, cleanup);
|
||||||
signal(SIGSEGV, cleanup);
|
signal(SIGSEGV, cleanup);
|
||||||
|
|
||||||
/* hide the cursor, prevent flicker during fancy graphics
|
|
||||||
printf("\033[?25l\033[?1c");
|
|
||||||
*/
|
|
||||||
|
|
||||||
/* i18n init */
|
/* i18n init */
|
||||||
lang=getenv("LC_ALL");
|
lang=getenv("LC_ALL");
|
||||||
if(lang==NULL || lang[0]=='\0')
|
if(lang==NULL || lang[0]=='\0')
|
||||||
@ -419,7 +407,7 @@ int main(int argc, char *argv[])
|
|||||||
lang=getenv("LANG");
|
lang=getenv("LANG");
|
||||||
|
|
||||||
setlocale(LC_ALL, lang);
|
setlocale(LC_ALL, lang);
|
||||||
// workaround for tr_TR
|
/* workaround for tr_TR */
|
||||||
if(lang && !strcmp(lang, "tr_TR"))
|
if(lang && !strcmp(lang, "tr_TR"))
|
||||||
setlocale(LC_CTYPE, "C");
|
setlocale(LC_CTYPE, "C");
|
||||||
bindtextdomain("pacman", "/usr/share/locale");
|
bindtextdomain("pacman", "/usr/share/locale");
|
||||||
|
@ -49,7 +49,6 @@
|
|||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
|
||||||
extern config_t *config;
|
extern config_t *config;
|
||||||
extern int neednl;
|
|
||||||
|
|
||||||
/* gets the current screen column width */
|
/* gets the current screen column width */
|
||||||
unsigned int getcols()
|
unsigned int getcols()
|
||||||
|
Loading…
Reference in New Issue
Block a user