-/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
-
+/* SPDX-License-Identifier: GPL-2.0+ */
/*
* Copyright (C) 2008-2009 Kay Sievers <kay@vrfy.org>
*
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "path-util.h"
#include "string-util.h"
#include "udevadm-util.h"
if (prefix && !startswith(id, prefix))
id = strjoina(prefix, id);
- if (startswith(id, "/dev/")) {
+ if (path_startswith(id, "/dev/")) {
struct stat statbuf;
char type;
return NULL;
return udev_device_new_from_devnum(udev, type, statbuf.st_rdev);
- } else if (startswith(id, "/sys/"))
+ } else if (path_startswith(id, "/sys/"))
return udev_device_new_from_syspath(udev, id);
else
return NULL;