diff options
author | axel <axel@liljencrantz.se> | 2009-02-03 08:46:45 +1000 |
---|---|---|
committer | axel <axel@liljencrantz.se> | 2009-02-03 08:46:45 +1000 |
commit | 72025a6a38e3aed4dadab5013dc64e0a432ba992 (patch) | |
tree | bb76f15f13c68e3ed4008da8f9e19d539c0524d0 /common.c | |
parent | 05341b055bb27c9a9036a1ebc99503fd4825e35f (diff) |
Make fish avoid iterating through user list when completing file part of directory starting with tilde. Also add a timeout to the directory iteration, to protect against humongously large user databases.
darcs-hash:20090202224645-ac50b-353047a73e4d6f494f470fe2ea6c4a34b486d302.gz
Diffstat (limited to 'common.c')
-rw-r--r-- | common.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -1805,3 +1805,18 @@ void sb_format_size( string_buffer_t *sb, } } } + +double timef() +{ + int time_res; + struct timeval tv; + + time_res = gettimeofday(&tv, 0); + + if( time_res ) + { + return NAN; + } + + return (double)tv.tv_sec + 0.000001*tv.tv_usec; +} |