File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -282,7 +282,7 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
282282 // "If the POSIXLY_CORRECT environment variable is set, then when echo’s first argument is not -n it outputs option-like arguments instead of treating them as options."
283283 // https://www.gnu.org/software/coreutils/manual/html_node/echo-invocation.html
284284
285- let no_newline = matches. get_flag ( options:: NO_NEWLINE ) ;
285+ let trailing_newline = ! matches. get_flag ( options:: NO_NEWLINE ) ;
286286 let escaped = matches. get_flag ( options:: ENABLE_BACKSLASH_ESCAPE ) ;
287287
288288 let mut stdout_lock = io:: stdout ( ) . lock ( ) ;
@@ -291,14 +291,14 @@ pub fn uumain(args: impl uucore::Args) -> UResult<()> {
291291 Some ( arguments_after_options) => {
292292 execute (
293293 & mut stdout_lock,
294- no_newline ,
294+ trailing_newline ,
295295 escaped,
296296 arguments_after_options,
297297 ) ?;
298298 }
299299 None => {
300300 // No strings to print, so just handle newline setting
301- if !no_newline {
301+ if trailing_newline {
302302 stdout_lock. write_all ( b"\n " ) ?;
303303 }
304304 }
@@ -350,7 +350,7 @@ pub fn uu_app() -> Command {
350350
351351fn execute (
352352 stdout_lock : & mut StdoutLock ,
353- no_newline : bool ,
353+ trailing_newline : bool ,
354354 escaped : bool ,
355355 arguments_after_options : ValuesRef < ' _ , OsString > ,
356356) -> UResult < ( ) > {
@@ -375,7 +375,7 @@ fn execute(
375375 }
376376 }
377377
378- if !no_newline {
378+ if trailing_newline {
379379 stdout_lock. write_all ( b"\n " ) ?;
380380 }
381381
You can’t perform that action at this time.
0 commit comments