*/
#include <algorithm>
+#include <vector>
#include <glib.h>
#include <glib/gstdio.h>
#include "pbd/file_utils.h"
#include "pbd/error.h"
#include "pbd/pathscanner.h"
+#include "pbd/stl_delete.h"
#include "i18n.h"
{
PathScanner scanner;
vector<string*>* files = scanner (from_path, accept_all_files, 0, true, false);
- for (vector<string*>::iterator i = files->begin(); i != files->end(); ++i) {
- std::string from = Glib::build_filename (from_path, **i);
- std::string to = Glib::build_filename (to_dir, **i);
- copy_file (from, to);
+
+ if (files) {
+ for (vector<string*>::iterator i = files->begin(); i != files->end(); ++i) {
+ std::string from = Glib::build_filename (from_path, **i);
+ std::string to = Glib::build_filename (to_dir, **i);
+ copy_file (from, to);
+ }
+ vector_delete (files);
}
}