1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Add default filename static.

This commit is contained in:
KokaKiwi 2014-01-16 02:59:05 +01:00
parent bc11734557
commit d20d119416

View file

@ -24,6 +24,8 @@ use std::ptr;
use std::str; use std::str;
use extra::getopts::groups; use extra::getopts::groups;
static DEFAULT_FILE: &'static str = "/var/run/utmp";
static UT_LINESIZE: uint = 32; static UT_LINESIZE: uint = 32;
static UT_NAMESIZE: uint = 32; static UT_NAMESIZE: uint = 32;
static UT_HOSTSIZE: uint = 256; static UT_HOSTSIZE: uint = 256;
@ -101,7 +103,7 @@ fn main() {
return; return;
} }
let mut filename = "/var/run/utmp"; let mut filename = DEFAULT_FILE;
if matches.free.len() > 0 { if matches.free.len() > 0 {
filename = matches.free[0].as_slice(); filename = matches.free[0].as_slice();
} }