Permalink
Browse files

Allow '/' in character device name

Accomodate character devices kept in a directory under /dev, e.g.,
the tun device in /dev/net/tun.
  • Loading branch information...
1 parent 2561888 commit 31e7592adc1be22a750a6ee8db914a32cefaa6d4 @msantos committed May 3, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 c_src/procket_cmd.c
  2. +1 −1 src/procket.erl
View
@@ -90,7 +90,7 @@ main(int argc, char *argv[])
usage(ps);
for (p = ps->dev; *p; p++) {
- if (!islower(*p) && !isdigit(*p))
+ if (!islower(*p) && !isdigit(*p) && *p != '/')
usage(ps);
}
}
View
@@ -254,7 +254,7 @@ is_interface(Name) when is_list(Name) ->
is_device(Name) when is_list(Name) ->
Name == [C || C <- Name, ((C >= $a) and (C =< $z))
- or ((C >= $0) and (C =< $9))].
+ or ((C >= $0) and (C =< $9) or (C == $/))].
progname() ->
filename:join([

0 comments on commit 31e7592

Please sign in to comment.