chiark / gitweb /
path_id: suppress trailing '-' like 'ID_PATH=pci-0000:05:01.0-'
authorKay Sievers <kay.sievers@vrfy.org>
Thu, 26 Jun 2008 11:25:31 +0000 (13:25 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Thu, 26 Jun 2008 11:25:31 +0000 (13:25 +0200)
extras/path_id/path_id

index 7a37700..0fad30c 100755 (executable)
@@ -95,7 +95,11 @@ handle_pci () {
                                ;;
                esac
        done
-       d="pci-$pci_id-$d"
+       if [ "$d" ]; then
+               d="pci-$pci_id-$d"
+       else
+               d="pci-$pci_id"
+       fi
        D="$host_dev_path"
        RESULT=0
 }