aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Shaw <[email protected]>2004-01-21 21:25:43 +0000
committerDavid Shaw <[email protected]>2004-01-21 21:25:43 +0000
commit01d0c54f05bdfc6a5aede03d86f8df120ca1145d (patch)
tree17818cc5ccc9508386d7c38e7d886d9a7d284f22
parent* keylist.c (set_attrib_fd): Open attribute fd in binary mode. This isn't (diff)
downloadgnupg-01d0c54f05bdfc6a5aede03d86f8df120ca1145d.tar.gz
gnupg-01d0c54f05bdfc6a5aede03d86f8df120ca1145d.zip
* keyedit.c (print_and_check_one_sig, keyedit_menu): Use the COLUMNS
environment variable (if any) to hint how wide the terminal is. Disabled on _WIN32. Suggested by Janusz A. Urbanowicz.
Diffstat (limited to '')
-rw-r--r--g10/ChangeLog7
-rw-r--r--g10/keyedit.c12
2 files changed, 18 insertions, 1 deletions
diff --git a/g10/ChangeLog b/g10/ChangeLog
index 03e3efd61..66566385b 100644
--- a/g10/ChangeLog
+++ b/g10/ChangeLog
@@ -1,3 +1,10 @@
+2004-01-21 David Shaw <[email protected]>
+
+ * keyedit.c (print_and_check_one_sig, keyedit_menu): Use the
+ COLUMNS environment variable (if any) to hint how wide the
+ terminal is. Disabled on _WIN32. Suggested by Janusz
+ A. Urbanowicz.
+
2004-01-20 David Shaw <[email protected]>
* keylist.c (set_attrib_fd): Open attribute fd in binary
diff --git a/g10/keyedit.c b/g10/keyedit.c
index 5ecec5941..50383b9e3 100644
--- a/g10/keyedit.c
+++ b/g10/keyedit.c
@@ -71,6 +71,7 @@ static int enable_disable_key( KBNODE keyblock, int disable );
static void menu_showphoto( KBNODE keyblock );
static int update_trust=0;
+static int columns=80;
#define CONTROL_D ('D' - 'A' + 1)
@@ -164,7 +165,7 @@ print_and_check_one_sig( KBNODE keyblock, KBNODE node,
else {
size_t n;
char *p = get_user_id( sig->keyid, &n );
- tty_print_utf8_string2( p, n, 40 );
+ tty_print_utf8_string2( p, n, columns-37 );
m_free(p);
}
tty_printf("\n");
@@ -1188,6 +1189,15 @@ keyedit_menu( const char *username, STRLIST locusr, STRLIST commands,
goto leave;
}
+#ifndef _WIN32
+ if(getenv("COLUMNS"))
+ {
+ columns=atoi(getenv("COLUMNS"));
+ if(columns<80 || columns>255)
+ columns=80;
+ }
+#endif
+
if( sign_mode ) {
commands = NULL;
append_to_strlist( &commands, sign_mode == 1? "sign":