Changeset 27684

Show
Ignore:
Timestamp:
12/31/08 18:05:28 (4 years ago)
Author:
saturday06
Message:

ioaszep;lr

Location:
lang/cplusplus/i3/trunk/src
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • lang/cplusplus/i3/trunk/src/Test2.cpp

    r27636 r27684  
    3838#ifdef MOL_OS_WINDOWS 
    3939    const TCHAR nulldevice[] = _T("nul"); 
    40 #else 
    41     const TCHAR nulldevice[] = _T("/dev/null"); 
     40    const TCHAR mkdir_p[] = _T("mkdir"); 
     41    i3::string cmd; 
     42    cmd = i3::string() + mkdir_p + _T("\"") + get_config_dir_path() + _T("\" 2>") + nulldevice; 
     43    const TCHAR* c = cmd.c_str(); 
     44    _tsystem(cmd.c_str()); 
    4245#endif 
    43     _tsystem((i3::string() + _T("mkdir \"") + get_config_dir_path() +  
    44                 _T("\" 2>") + nulldevice).c_str()); 
    45  
    46  
    4746 
    4847    _tremove(temp); 
  • lang/cplusplus/i3/trunk/src/os-unix/Os.cpp

    r27462 r27684  
    1919    } 
    2020 
    21     if (strcpy_s(config_dir_path, home_tmp) == 0) 
     21    memset(config_dir_path, 0, sizeof(config_dir_path)); 
     22 
     23    if (strcpy_s(config_dir_path, home_tmp) != 0) 
    2224    { 
    2325        return; 
     
    3335        //TODO: check dir 
    3436        struct stat st; 
    35         if (stat(config_dir_path,&st) && mkdir(config_dir_path, 0600)) 
     37        if (stat(config_dir_path, &st) && mkdir(config_dir_path, 0600)) 
    3638        { 
    3739            // error