diff options
author | John Gilmore <gnu@cygnus> | 1992-12-15 11:19:30 +0000 |
---|---|---|
committer | John Gilmore <gnu@cygnus> | 1992-12-15 11:19:30 +0000 |
commit | 631f7a9f7c9d520973aec40b9ef090cc59b3caa0 (patch) | |
tree | 2f8a619f3afbe369dc2123edb38445ec76660af0 /gdb/infcmd.c | |
parent | fb29d6816150483a00a81ff2f5c9724e7763590e (diff) | |
download | gdb-631f7a9f7c9d520973aec40b9ef090cc59b3caa0.zip gdb-631f7a9f7c9d520973aec40b9ef090cc59b3caa0.tar.gz gdb-631f7a9f7c9d520973aec40b9ef090cc59b3caa0.tar.bz2 |
Avoid printf_filtered limit.
Diffstat (limited to 'gdb/infcmd.c')
-rw-r--r-- | gdb/infcmd.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/gdb/infcmd.c b/gdb/infcmd.c index 4230b66..89859fe 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -740,15 +740,27 @@ environment_info (var, from_tty) { register char *val = get_in_environ (inferior_environ, var); if (val) - printf_filtered ("%s = %s\n", var, val); + { + puts_filtered (var); + puts_filtered (" = "); + puts_filtered (val); + puts_filtered ("\n"); + } else - printf_filtered ("Environment variable \"%s\" not defined.\n", var); + { + puts_filtered ("Environment variable \""); + puts_filtered (var); + puts_filtered ("\" not defined.\n"); + } } else { register char **vector = environ_vector (inferior_environ); while (*vector) - printf_filtered ("%s\n", *vector++); + { + puts_filtered (*vector++); + puts_filtered ("\n"); + } } } @@ -770,16 +782,15 @@ set_environment_command (arg, from_tty) if (p != 0 && val != 0) { /* We have both a space and an equals. If the space is before the - equals and the only thing between the two is more space, use - the equals */ + equals, walk forward over the spaces til we see a nonspace + (possibly the equals). */ if (p > val) while (*val == ' ') val++; - /* Take the smaller of the two. If there was space before the - "=", they will be the same right now. */ - - if (val < p) + /* Now if the = is after the char following the spaces, + take the char following the spaces. */ + if (p > val) p = val - 1; } else if (val != 0 && p == 0) |