Subject: Echo builtin has extra new line -- patch

From: Greg Badros <[email-masked]>
Date: 22 Jan 1997 17:11:51 -0800

Below is a simple patch to remove the extra new-line character when
using the "Echo" builtin function:

(I don't like the extra space in my .FVWM2-errors file:

[FVWM][Echo]:  Including file showdefs...

[FVWM][Echo]:  Including file buttons...

[FVWM][Echo]:  Including file functions...

[FVWM][Echo]:  Including file mouse...

[FVWM][Echo]:  Including file keys...

)

*** builtins.c  Wed Jan 22 05:37:28 1997
--- ../../fvwm-2.0.44-almost/fvwm/builtins.c    Wed Jan  8 14:50:49 1997
***************
*** 1134,1139 ****
--- 1134,1141 ----
  {
    if (action && *action)
    {
+     /* chop off \n */
+     action[strlen(action)-1] = 0;
      fvwm_msg(INFO,"Echo",action);
    }
  }
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked] (Albrecht Kadlec)
Date: Mon, 27 Jan 97 14:06:58 +0100

>>>>> Greg Badros writes:

G> Below is a simple patch to remove the extra new-line character when
G> using the "Echo" builtin function:

G> (I don't like the extra space in my .FVWM2-errors file:

G> [FVWM][Echo]:  Including file showdefs...

G> [FVWM][Echo]:  Including file buttons...

G> [FVWM][Echo]:  Including file functions...

G> [FVWM][Echo]:  Including file mouse...

G> [FVWM][Echo]:  Including file keys...

G> )

G> *** builtins.c  Wed Jan 22 05:37:28 1997
G> --- ../../fvwm-2.0.44-almost/fvwm/builtins.c    Wed Jan  8 14:50:49 1997
G> ***************
G> *** 1134,1139 ****
G> --- 1134,1141 ----
G>   {
G>     if (action && *action)
G>     {
G> +     /* chop off \n */
G> +     action[strlen(action)-1] = 0;
G>       fvwm_msg(INFO,"Echo",action);
G>     }
G>   }

how about chopping off the \n just after reading the line -
not in 1000 position where it's possibly parsed.
(also we should probably test, if it's \n, if we don't remove it right
after readln()) 

albrecht - just trying to keep the code smaller & simpler.
-- 
Overhead the albatross hangs	    |  And everything is green and submarine
Motionless upon the air		    |  And no one showed us to the land
And deep beneath the rolling waves  |  And no one knows the wheres or whys

In labyrinths of coral caves	    |  But something stares
The echo of a distant tide	    |  And something tries
Comes willowing across the sand     |  And starts to climb towards the light
							-- Pink Floyd, "Echoes"
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].