Skip to content

Commit

Permalink
Allow '/' in character device name
Browse files Browse the repository at this point in the history
Accomodate character devices kept in a directory under /dev, e.g.,
the tun device in /dev/net/tun.
  • Loading branch information
msantos committed May 3, 2011
1 parent 2561888 commit 31e7592
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion c_src/procket_cmd.c
Expand Up @@ -90,7 +90,7 @@ main(int argc, char *argv[])
usage(ps); usage(ps);


for (p = ps->dev; *p; p++) { for (p = ps->dev; *p; p++) {
if (!islower(*p) && !isdigit(*p)) if (!islower(*p) && !isdigit(*p) && *p != '/')
usage(ps); usage(ps);
} }
} }
Expand Down
2 changes: 1 addition & 1 deletion src/procket.erl
Expand Up @@ -254,7 +254,7 @@ is_interface(Name) when is_list(Name) ->


is_device(Name) when is_list(Name) -> is_device(Name) when is_list(Name) ->
Name == [C || C <- Name, ((C >= $a) and (C =< $z)) Name == [C || C <- Name, ((C >= $a) and (C =< $z))
or ((C >= $0) and (C =< $9))]. or ((C >= $0) and (C =< $9) or (C == $/))].


progname() -> progname() ->
filename:join([ filename:join([
Expand Down

0 comments on commit 31e7592

Please sign in to comment.