diff options
Diffstat (limited to 'commands/echo.c')
-rw-r--r-- | commands/echo.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/commands/echo.c b/commands/echo.c index a19d99292f..8929234aab 100644 --- a/commands/echo.c +++ b/commands/echo.c @@ -15,9 +15,6 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include <common.h> @@ -33,10 +30,9 @@ static int do_echo(int argc, char *argv[]) int fd = stdout, opt, newline = 1; char *file = NULL; int oflags = O_WRONLY | O_CREAT; -#ifdef CONFIG_CMD_ECHO_E char str[CONFIG_CBSIZE]; int process_escape = 0; -#endif + /* We can't use getopt() here because we want to * echo all things we don't understand. */ @@ -66,11 +62,9 @@ static int do_echo(int argc, char *argv[]) goto no_optarg_out; optind++; break; -#ifdef CONFIG_CMD_ECHO_E case 'e': - process_escape = 1; + process_escape = IS_ENABLED(CONFIG_CMD_ECHO_E); break; -#endif default: goto exit_parse; } @@ -89,13 +83,12 @@ exit_parse: for (i = optind; i < argc; i++) { if (i > optind) fputc(fd, ' '); -#ifdef CONFIG_CMD_ECHO_E if (process_escape) { process_escape_sequence(argv[i], str, CONFIG_CBSIZE); fputs(fd, str); - } else -#endif + } else { fputs(fd, argv[i]); + } } if (newline) |