Module Name: src Committed By: kre Date: Thu Aug 5 12:45:33 UTC 2021
Modified Files: src/sbin/devpubd: devpubd-run-hooks.in src/sbin/devpubd/hooks: 01-makedev Log Message: Expunge bogus (implementation defined / unspecified) uses of $@ in scripts. $@ is unspecified except when used in a place where field splitting can occur (which is never in an assignment), X=$@ (with or without double quotes) is simply wrong. Use $* instead of $@ in such places, or as here, simply change the way things are done (very very slightly) and DTRT. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/sbin/devpubd/devpubd-run-hooks.in cvs rdiff -u -r1.2 -r1.3 src/sbin/devpubd/hooks/01-makedev Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sbin/devpubd/devpubd-run-hooks.in diff -u src/sbin/devpubd/devpubd-run-hooks.in:1.3 src/sbin/devpubd/devpubd-run-hooks.in:1.4 --- src/sbin/devpubd/devpubd-run-hooks.in:1.3 Sun Feb 15 15:56:30 2015 +++ src/sbin/devpubd/devpubd-run-hooks.in Thu Aug 5 12:45:33 2021 @@ -1,19 +1,19 @@ #!/bin/sh # -# $NetBSD: devpubd-run-hooks.in,v 1.3 2015/02/15 15:56:30 jmcneill Exp $ +# $NetBSD: devpubd-run-hooks.in,v 1.4 2021/08/05 12:45:33 kre Exp $ # # devpubd run hooks devpubd_event=$1 shift -devpubd_devices=$@ + devpubd_hooks_base=@HOOKSDIR@ case $devpubd_event in device-attach|device-detach) for hook in ${devpubd_hooks_base}/*; do if [ -x "${hook}" ]; then - "${hook}" ${devpubd_event} ${devpubd_devices} + "${hook}" ${devpubd_event} "$@" fi done ;; Index: src/sbin/devpubd/hooks/01-makedev diff -u src/sbin/devpubd/hooks/01-makedev:1.2 src/sbin/devpubd/hooks/01-makedev:1.3 --- src/sbin/devpubd/hooks/01-makedev:1.2 Sun Feb 15 15:56:30 2015 +++ src/sbin/devpubd/hooks/01-makedev Thu Aug 5 12:45:33 2021 @@ -1,16 +1,15 @@ #!/bin/sh # -# $NetBSD: 01-makedev,v 1.2 2015/02/15 15:56:30 jmcneill Exp $ +# $NetBSD: 01-makedev,v 1.3 2021/08/05 12:45:33 kre Exp $ # # Try to create a device node if it doesn't exist # event="$1" shift -devices=$@ case $event in device-attach) - cd /dev && sh MAKEDEV -u $devices 2>/dev/null + cd /dev && sh MAKEDEV -u "$@" 2>/dev/null ;; esac