Fixed a relative path usage
This commit is contained in:
parent
8b49add1be
commit
d0ca6c8af9
@ -10,13 +10,17 @@ ______________________________________________________________________
|
|||||||
Notes for GoldED+ 1.1.5, /snapshot/
|
Notes for GoldED+ 1.1.5, /snapshot/
|
||||||
______________________________________________________________________
|
______________________________________________________________________
|
||||||
|
|
||||||
|
- Relative path usage is fixed. Now a Real UID is used to parse "~/" always.
|
||||||
|
|
||||||
+ Several unicode charset convertion tables is included into distribution of
|
+ Several unicode charset convertion tables is included into distribution of
|
||||||
the config examples.
|
the config examples.
|
||||||
|
|
||||||
+ Relative path may be used for patchnames definiions in config. User's home
|
+ Gedlnx: Relative path may be used for patchnames definiions in config.
|
||||||
directory (~/) may be used in unixes. Example:
|
User's home directory (~/) may be used in unixes. Examples:
|
||||||
|
|
||||||
include ~/golded.cfg ; include the user-specific subconfig
|
include ~/golded.cfg ; include the user-specific subconfig of current user
|
||||||
|
include ~fido/configs/golded.cfg ; include specific subconfig of user fido
|
||||||
|
seqdir ~fido ; specify MSGID-sequence store path to /home/fido/
|
||||||
|
|
||||||
! Temporarily disabled the AreaRecycleBin.
|
! Temporarily disabled the AreaRecycleBin.
|
||||||
|
|
||||||
|
@ -317,11 +317,9 @@ void TouchFile(const char* filename) {
|
|||||||
|
|
||||||
char* PathCopy(char* __dst, const char* __src) {
|
char* PathCopy(char* __dst, const char* __src) {
|
||||||
strschg_environ(strxcpy(__dst, __src, sizeof(Path)));
|
strschg_environ(strxcpy(__dst, __src, sizeof(Path)));
|
||||||
getcwd(__dst, sizeof(Path)); // expand ~/ & etc.
|
|
||||||
return AddBackslash(__dst);
|
return AddBackslash(__dst);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|
||||||
int TestLockPath(const char* __path) {
|
int TestLockPath(const char* __path) {
|
||||||
|
@ -89,16 +89,16 @@ int strschg_environ(std::string& s) {
|
|||||||
std::string name;
|
std::string name;
|
||||||
char* lname;
|
char* lname;
|
||||||
const char *p = s.c_str()+1;
|
const char *p = s.c_str()+1;
|
||||||
|
struct passwd *pe=NULL;
|
||||||
|
|
||||||
if((s.length() != 1) and not isslash(*p)) {
|
if((s.length() != 1) and not isslash(*p)) {
|
||||||
while(*p and not isslash(*p))
|
while(*p and not isslash(*p))
|
||||||
name += *p++;
|
name += *p++;
|
||||||
|
pe = getpwnam(name.c_str());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if ((lname = getlogin()) == NULL)
|
pe = getpwuid(getuid());
|
||||||
lname = getenv("LOGNAME");
|
|
||||||
name = lname;
|
|
||||||
}
|
}
|
||||||
struct passwd *pe = getpwnam(name.c_str());
|
|
||||||
if(pe != NULL) {
|
if(pe != NULL) {
|
||||||
std::string dirname = pe->pw_dir;
|
std::string dirname = pe->pw_dir;
|
||||||
dirname += "/";
|
dirname += "/";
|
||||||
|
Reference in New Issue
Block a user