1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

make function arguments immutable

This commit is contained in:
Alexander Medvednikov
2019-07-05 00:20:59 +02:00
parent 74dbb1bce3
commit 0f0ed8d716
8 changed files with 42 additions and 33 deletions

View File

@ -262,8 +262,8 @@ fn popen(path string) *FILE {
}
// exec starts the specified command, waits for it to complete, and returns its output.
pub fn exec(cmd string) string {
cmd = '$cmd 2>&1'
pub fn exec(_cmd string) string {
cmd := '$_cmd 2>&1'
f := popen(cmd)
if isnil(f) {
// TODO optional or error code
@ -331,8 +331,8 @@ pub fn dir_exists(path string) bool {
// mkdir creates a new directory with the specified path.
pub fn mkdir(path string) {
$if windows {
path = path.replace('/', '\\')
C.CreateDirectory(path.cstr(), 0)
_path := path.replace('/', '\\')
C.CreateDirectory(_path.cstr(), 0)
}
$else {
C.mkdir(path.cstr(), 511)// S_IRWXU | S_IRWXG | S_IRWXO