diff options
| -rw-r--r-- | src/path.cc | 20 | ||||
| -rw-r--r-- | src/path.h | 7 | 
2 files changed, 12 insertions, 15 deletions
| diff --git a/src/path.cc b/src/path.cc index 5c899f2..43c64f0 100644 --- a/src/path.cc +++ b/src/path.cc @@ -33,19 +33,19 @@  #include <string.h>  #include <stdlib.h> -std::string getPath(std::string file) +std::string getPath(const std::string& file)  { -  std::string p; +	std::string p;  #ifndef __MINGW32__ -  char *b = strdup(file.c_str()); -  p = dirname(b); -  free(b); +	char *b = strdup(file.c_str()); +	p = dirname(b); +	free(b);  #else -  char drive[_MAX_DRIVE]; -  char dir[_MAX_DIR]; -  _splitpath(file.c_str(), drive, dir, NULL, NULL); -  p = std::string(drive) + dir; +	char drive[_MAX_DRIVE]; +	char dir[_MAX_DIR]; +	_splitpath(file.c_str(), drive, dir, NULL, NULL); +	p = std::string(drive) + dir;  #endif -  return p; +	return p;  } @@ -24,11 +24,8 @@   *  along with DrumGizmo; if not, write to the Free Software   *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA.   */ -#ifndef __DRUMGIZMO_PATH_H__ -#define __DRUMGIZMO_PATH_H__ +#pragma once  #include <string> -std::string getPath(std::string file); - -#endif/*__DRUMGIZMO_PATH_H__*/ +std::string getPath(const std::string& file); | 
