=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/midicat/midicat.c,v retrieving revision 1.5 retrieving revision 1.6 diff -c -r1.5 -r1.6 *** src/usr.bin/midicat/midicat.c 2022/12/02 22:21:35 1.5 --- src/usr.bin/midicat/midicat.c 2022/12/02 22:29:59 1.6 *************** *** 1,4 **** ! /* $OpenBSD: midicat.c,v 1.5 2022/12/02 22:21:35 cheloha Exp $ */ /* * Copyright (c) 2015 Alexandre Ratchov * --- 1,4 ---- ! /* $OpenBSD: midicat.c,v 1.6 2022/12/02 22:29:59 cheloha Exp $ */ /* * Copyright (c) 2015 Alexandre Ratchov * *************** *** 92,100 **** /* open input or output file (if any) */ if (ifile) { ! if (strcmp(ifile, "-") == 0) ifd = STDIN_FILENO; ! else { ifd = open(ifile, O_RDONLY); if (ifd == -1) { perror(ifile); --- 92,101 ---- /* open input or output file (if any) */ if (ifile) { ! if (strcmp(ifile, "-") == 0) { ! ifile = "stdin"; ifd = STDIN_FILENO; ! } else { ifd = open(ifile, O_RDONLY); if (ifd == -1) { perror(ifile); *************** *** 102,110 **** } } } else if (ofile) { ! if (strcmp(ofile, "-") == 0) ofd = STDOUT_FILENO; ! else { ofd = open(ofile, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (ofd == -1) { perror(ofile); --- 103,112 ---- } } } else if (ofile) { ! if (strcmp(ofile, "-") == 0) { ! ofile = "stdout"; ofd = STDOUT_FILENO; ! } else { ofd = open(ofile, O_WRONLY | O_CREAT | O_TRUNC, 0666); if (ofd == -1) { perror(ofile);