2.5 filebrowser
* show only name of the last directory for the bookmark * small fix of projectfile: header BLI_fileops.h was moved Note: full path should appear in tool tip later, also for renaming bookmarks later on.
This commit is contained in:
@@ -736,6 +736,25 @@ void BLI_splitdirstring(char *di, char *fi)
|
||||
}
|
||||
}
|
||||
|
||||
void BLI_getlastdir(const char* dir, char *last, int maxlen)
|
||||
{
|
||||
char *s = dir;
|
||||
char *lslash = NULL;
|
||||
char *prevslash = NULL;
|
||||
while (*s) {
|
||||
if ((*s == '\\') || (*s == '/')) {
|
||||
prevslash = lslash;
|
||||
lslash = s;
|
||||
}
|
||||
s++;
|
||||
}
|
||||
if (prevslash) {
|
||||
BLI_strncpy(last, prevslash+1, maxlen);
|
||||
} else {
|
||||
BLI_strncpy(last, dir, maxlen);
|
||||
}
|
||||
}
|
||||
|
||||
char *BLI_gethome(void) {
|
||||
#if !defined(WIN32)
|
||||
return getenv("HOME");
|
||||
|
||||
Reference in New Issue
Block a user