projects
/
apps
/
madmutt.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
missing includes, intializers, consts
[apps/madmutt.git]
/
curs_lib.c
diff --git
a/curs_lib.c
b/curs_lib.c
index
3e03810
..
0cb31c6
100644
(file)
--- a/
curs_lib.c
+++ b/
curs_lib.c
@@
-27,6
+27,7
@@
#include "lib/str.h"
#include "lib/debug.h"
#include "lib/str.h"
#include "lib/debug.h"
+#include <wchar.h>
#include <termios.h>
#include <sys/types.h>
#include <fcntl.h>
#include <termios.h>
#include <sys/types.h>
#include <fcntl.h>
@@
-114,7
+115,7
@@
event_t mutt_getch (void)
return (ch == ctrl ('G') ? err : ret);
}
return (ch == ctrl ('G') ? err : ret);
}
-int _mutt_get_field (
/* const */
char *field, char *buf, size_t buflen,
+int _mutt_get_field (
const
char *field, char *buf, size_t buflen,
int complete, int multiple, char ***files, int *numfiles)
{
int ret;
int complete, int multiple, char ***files, int *numfiles)
{
int ret;
@@
-156,19
+157,6
@@
void mutt_clear_error (void)
CLEARLINE (LINES - 1);
}
CLEARLINE (LINES - 1);
}
-static void fix_end_of_file (const char *data)
-{
- FILE *fp;
- int c;
-
- if ((fp = safe_fopen (data, "a+")) == NULL)
- return;
- fseek (fp, -1, SEEK_END);
- if ((c = fgetc (fp)) != '\n')
- fputc ('\n', fp);
- safe_fclose (&fp);
-}
-
void mutt_edit_file (const char *editor, const char *data)
{
char cmd[LONG_STRING];
void mutt_edit_file (const char *editor, const char *data)
{
char cmd[LONG_STRING];
@@
-177,7
+165,6
@@
void mutt_edit_file (const char *editor, const char *data)
mutt_expand_file_fmt (cmd, sizeof (cmd), editor, data);
if (mutt_system (cmd) == -1)
mutt_error (_("Error running \"%s\"!"), cmd);
mutt_expand_file_fmt (cmd, sizeof (cmd), editor, data);
if (mutt_system (cmd) == -1)
mutt_error (_("Error running \"%s\"!"), cmd);
- fix_end_of_file (data);
keypad (stdscr, TRUE);
clearok (stdscr, TRUE);
}
keypad (stdscr, TRUE);
clearok (stdscr, TRUE);
}
@@
-310,6
+297,7
@@
void mutt_curses_error (const char *fmt, ...)
set_option (OPTMSGERR);
}
set_option (OPTMSGERR);
}
+#ifdef USE_SOCKET
void mutt_progress_bar (progress_t* progress, long pos) {
char posstr[SHORT_STRING];
void mutt_progress_bar (progress_t* progress, long pos) {
char posstr[SHORT_STRING];
@@
-317,8
+305,9
@@
void mutt_progress_bar (progress_t* progress, long pos) {
if (!NetInc)
mutt_message (progress->msg);
else {
if (!NetInc)
mutt_message (progress->msg);
else {
- mutt_pretty_size (progress->sizestr, sizeof (progress->sizestr),
- progress->size);
+ if (progress->size)
+ mutt_pretty_size (progress->sizestr, sizeof (progress->sizestr),
+ progress->size);
progress->pos = 0;
}
}
progress->pos = 0;
}
}
@@
-326,13
+315,17
@@
void mutt_progress_bar (progress_t* progress, long pos) {
if (!NetInc)
return;
if (!NetInc)
return;
- if (pos > progress->pos + (NetInc << 10)) {
+ if (pos >
=
progress->pos + (NetInc << 10)) {
progress->pos = pos;
pos = pos / (NetInc << 10) * (NetInc << 10);
mutt_pretty_size (posstr, sizeof (posstr), pos);
progress->pos = pos;
pos = pos / (NetInc << 10) * (NetInc << 10);
mutt_pretty_size (posstr, sizeof (posstr), pos);
- mutt_message ("%s %s/%s", progress->msg, posstr, progress->sizestr);
+ if (progress->size)
+ mutt_message ("%s %s/%s", progress->msg, posstr, progress->sizestr);
+ else
+ mutt_message ("%s %s", progress->msg, posstr);
}
}
}
}
+#endif
void mutt_curses_message (const char *fmt, ...)
{
void mutt_curses_message (const char *fmt, ...)
{