mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fix for service issue with paths having spaces (bug #687)
This commit is contained in:
@ -100,6 +100,7 @@ extern int NEAR my_errno; /* Last error in mysys */
|
||||
#define MY_RETURN_REAL_PATH 32 /* return full path for file */
|
||||
#define MY_SAFE_PATH 64 /* Return NULL if too long path */
|
||||
#define MY_RELATIVE_PATH 128 /* name is relative to 'dir' */
|
||||
#define MY_QUOTE_SPACES 256 /* quote when the path has spaces */
|
||||
|
||||
/* My seek flags */
|
||||
#define MY_SEEK_SET 0
|
||||
|
@ -111,6 +111,14 @@ my_string fn_format(my_string to, const char *name, const char *dir,
|
||||
strmov(buff,to);
|
||||
(void) my_readlink(to, buff, MYF(0));
|
||||
}
|
||||
if ( flag & MY_QUOTE_SPACES)
|
||||
if ( strchr(to, ' '))
|
||||
{
|
||||
char tmp_buff[FN_REFLEN];
|
||||
tmp_buff[0]='"';
|
||||
strxmov(tmp_buff+1,to,"\"",NullS);
|
||||
strmov(to,tmp_buff);
|
||||
}
|
||||
DBUG_RETURN (to);
|
||||
} /* fn_format */
|
||||
|
||||
|
@ -2559,7 +2559,8 @@ int main(int argc, char **argv)
|
||||
{
|
||||
char file_path[FN_REFLEN];
|
||||
my_path(file_path, argv[0], ""); /* Find name in path */
|
||||
fn_format(file_path,argv[0],file_path,"",1+4+16); /* Force full path */
|
||||
fn_format(file_path,argv[0],file_path,"",MY_REPLACE_DIR+
|
||||
MY_UNPACK_FILENAME+MY_RESOLVE_SYMLINKS+MY_QUOTE_SPACES);
|
||||
|
||||
if (argc == 2)
|
||||
{
|
||||
@ -2605,8 +2606,10 @@ int main(int argc, char **argv)
|
||||
mysqld --install-manual mysqldopt --defaults-file=c:\miguel\my.ini
|
||||
*/
|
||||
uint length=strlen(file_path);
|
||||
char tmp_path[FN_REFLEN];
|
||||
fn_format(tmp_path,argv[3],tmp_path,"",MY_QUOTE_SPACES);
|
||||
*strxnmov(file_path + length, sizeof(file_path)-length-2, " ",
|
||||
argv[3], " ", argv[2], NullS)= '\0';
|
||||
tmp_path, " ", argv[2], NullS)= '\0';
|
||||
if (!default_service_handling(argv, argv[2], argv[2], file_path))
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user