* GPL HEADER END
*/
/*
- * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*/
/*
int lcfg_set_devname(char *name)
{
+ char *ptr;
+ int digit = 1;
+
if (name) {
if (lcfg_devname)
free(lcfg_devname);
/* quietly strip the unnecessary '$' */
if (*name == '$' || *name == '%')
name++;
- if (isdigit(*name)) {
+
+ ptr = name;
+ while (*ptr != '\0') {
+ if (!isdigit(*ptr)) {
+ digit = 0;
+ break;
+ }
+ ptr++;
+ }
+
+ if (digit) {
/* We can't translate from dev # to name */
lcfg_devname = NULL;
} else {
}
struct param_opts {
- int only_path;
- int show_path;
- int show_type;
- int recursive;
+ int only_path:1;
+ int show_path:1;
+ int show_type:1;
+ int recursive:1;
};
static int listparam_cmdline(int argc, char **argv, struct param_opts *popt)
popt->show_path = 1;
popt->only_path = 0;
popt->show_type = 0;
+ popt->recursive = 0;
while ((ch = getopt(argc, argv, "nNF")) != -1) {
switch (ch) {
popt->show_path = 1;
popt->only_path = 0;
popt->show_type = 0;
+ popt->recursive = 0;
while ((ch = getopt(argc, argv, "n")) != -1) {
switch (ch) {