rtoss

Subversion Repositories:
Compare Path: Rev
With Path: Rev
/lil script runner/ @ 274  →  /lil script runner/ @ 275
/lil script runner/main.c
@@ -24,7 +24,9 @@
#define _BSD_SOURCE
#ifndef WIN32
#include <unistd.h>
#define MAX_PATH 256
#else
#include <direct.h>
#include <windows.h>
#include <shlobj.h>
#endif
@@ -36,7 +38,6 @@
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <direct.h>
#include "lil.h"
 
static int running = 1;
New file
/lil script runner/strrpos.lil
@@ -0,0 +1,24 @@
func strrpos {str find last} {
set i 0
set j 0
set first 1
if [expr $last > 0] {
set str [substr $str 0 $last]
}
while not {$i == -1} {
if $first {
set first 0
set i -1
}
set j $i
set i [strpos $str $find [expr $i + 1]]
if [expr $i == -1] {
return $j
}
}
return -1
}
 
# Get $EXEPATH
set a [strrpos [lilpath] "\\" 0]
print [substr [lilpath] 0 $a]