SCCS-vsn: bin/dd/dd.c 5.9
SCCS-vsn: bin/dd/args.c 5.5
-static char sccsid[] = "@(#)args.c 5.4 (Berkeley) %G%";
+static char sccsid[] = "@(#)args.c 5.5 (Berkeley) %G%";
#endif /* not lint */
#include <sys/types.h>
#endif /* not lint */
#include <sys/types.h>
* just wanted to set both the input and output block sizes
* and didn't want the bs semantics, so we don't warn.
*/
* just wanted to set both the input and output block sizes
* and didn't want the bs semantics, so we don't warn.
*/
- if (ddflags & (C_BLOCK|C_LCASE|C_UCASE|C_UNBLOCK))
+ if (ddflags & (C_BLOCK|C_LCASE|C_SWAB|C_UCASE|C_UNBLOCK))
ddflags &= ~C_BS;
/* Bs supersedes ibs and obs. */
ddflags &= ~C_BS;
/* Bs supersedes ibs and obs. */
#endif /* not lint */
#ifndef lint
#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)dd.c 5.8 (Berkeley) %G%";
+static char sccsid[] = "@(#)dd.c 5.9 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#endif /* not lint */
#include <sys/param.h>
- if (ddflags & C_SWAB) {
- if ((n = in.dbcnt) & 1) {
- ++st.swab;
- --n;
- }
- swab(in.dbp, in.dbp, n);
- }
-
/*
* POSIX states that if bs is set and no other conversions
/*
* POSIX states that if bs is set and no other conversions
- * are specified, the block is output without buffering as
- * it is read.
+ * than noerror, notrunc or sync are specified, the block
+ * is output without buffering as it is read.
*/
if (ddflags & C_BS) {
out.dbcnt = in.dbcnt;
*/
if (ddflags & C_BS) {
out.dbcnt = in.dbcnt;
+ if (ddflags & C_SWAB) {
+ if ((n = in.dbcnt) & 1) {
+ ++st.swab;
+ --n;
+ }
+ swab(in.dbp, in.dbp, n);
+ }
+
in.dbp += in.dbrcnt;
(*cfunc)();
}
in.dbp += in.dbrcnt;
(*cfunc)();
}