X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fudev%2Fudevadm.c;h=e14b3ca27c0248f9c063a38f13e65f1e872a7846;hp=d1e9756b2e5f3417e95c5cbead0c58f8348b9770;hb=486cd82c8f7642016895b72bcc09a1bfe885a783;hpb=796b06c21b62d13c9021e2fbd9c58a5c6edb2764 diff --git a/src/udev/udevadm.c b/src/udev/udevadm.c index d1e9756b2..e14b3ca27 100644 --- a/src/udev/udevadm.c +++ b/src/udev/udevadm.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2007-2012 Kay Sievers + * Copyright (C) 2007-2012 Kay Sievers * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -131,10 +131,11 @@ int main(int argc, char *argv[]) if (command != NULL) for (i = 0; i < ELEMENTSOF(udevadm_cmds); i++) { - if (strcmp(udevadm_cmds[i]->name, command) == 0) { + if (streq(udevadm_cmds[i]->name, command)) { argc -= optind; argv += optind; - optind = 1; + /* we need '0' here to reset the internal state */ + optind = 0; rc = run_command(udev, udevadm_cmds[i], argc, argv); goto out; }