Fix broken umask, add completions, documentation cleanups, etc

darcs-hash:20051022100605-ac50b-9b6ece502b203bf7690583d57b5b0713de30890c.gz
This commit is contained in:
axel
2005-10-22 20:06:05 +10:00
parent 6139df926b
commit fc5e0ab367
6 changed files with 124 additions and 69 deletions

20
env.c
View File

@@ -15,7 +15,6 @@
#include <sys/stat.h>
#include <pwd.h>
#if HAVE_NCURSES_H
#include <ncurses.h>
#else
@@ -27,6 +26,7 @@
#endif
#include <term.h>
#include <errno.h>
#include "util.h"
#include "wutil.h"
@@ -385,6 +385,24 @@ void env_set( const wchar_t *key,
fish_setlocale(LC_ALL,val);
}
if( wcscmp( key, L"umask" ) == 0)
{
wchar_t *end;
int mask;
if( val && wcslen(val) )
{
errno=0;
mask = wcstol( val, &end, 8 );
if( !errno && !*end )
{
umask( mask );
}
}
}
/*
Zero element arrays are internaly not coded as null but as this placeholder string
*/