added line feeds when needed (patch from VMiklos <vmiklos@frugalware.org>)

This commit is contained in:
Aurelien Foret 2006-02-01 18:20:13 +00:00
parent de3a0f164c
commit cdc97dd6f2
3 changed files with 8 additions and 1 deletions

View file

@ -35,7 +35,7 @@
extern config_t *config;
static int neednl; /* for cleaner message output */
int neednl; /* for cleaner message output */
/* Callback to handle notifications from the library
*/

View file

@ -59,6 +59,8 @@ list_t *pm_targets = NULL;
int maxcols = 80;
extern int neednl;
int main(int argc, char *argv[])
{
int ret = 0;
@ -246,6 +248,9 @@ void cleanup(int signum)
muntrace();
#endif
if(neednl) {
putchar('\n');
}
fflush(stdout);
exit(signum);

View file

@ -40,6 +40,7 @@
#include "conf.h"
extern int maxcols;
extern int neednl;
extern config_t *config;
/* does the same thing as 'mkdir -p' */
@ -203,6 +204,7 @@ int yesno(char *fmt, ...)
vprintf(fmt, args);
va_end(args);
fflush(stdout);
neednl = 1;
if(fgets(response, 32, stdin)) {
/* trim whitespace and newlines */
char *pch = response;