ALT Linux Bugzilla
– Attachment 1061 Details for
Bug 7672
madman не находит файлы
New bug
|
Search
|
[?]
|
Help
Register
|
Log In
[x]
|
Forgot Password
Login:
[x]
|
EN
|
RU
[patch]
madman-0.93-gns-scanfix2.patch
madman-0.93-gns-scanfix2.patch (text/plain), 1.35 KB, created by
Vladimir V. Kamarzin
on 2005-08-18 14:38:39 MSD
(
hide
)
Description:
madman-0.93-gns-scanfix2.patch
Filename:
MIME Type:
Creator:
Vladimir V. Kamarzin
Created:
2005-08-18 14:38:39 MSD
Size:
1.35 KB
patch
obsolete
>--- madman-0.93rc2/utility/base.cpp.orig 2004-03-28 22:22:30 +0600 >+++ madman-0.93rc2/utility/base.cpp 2005-08-18 15:19:47 +0600 >@@ -25,6 +25,7 @@ > #include <qregexp.h> > #include <stdexcept> > #include <dirent.h> >+#include <sys/stat.h> > #include "utility/progress.h" > > >@@ -304,12 +305,12 @@ > else > realdir = directory; > >- try >- { > dir = opendir(realdir.c_str()); > if (dir == NULL) > throw runtime_error(("could not open directory: "+directory).c_str()); > >+ try >+ { > while ((entry = readdir(dir))) > { > if (strcmp(entry->d_name, ".") == 0) >@@ -319,10 +320,21 @@ > > if (prog) > prog->setProgress(prog->progress() + 1); >- if (entry->d_type == DT_DIR) >- enumerateFiles(realdir + "/" + entry->d_name, result, prog); >- else if (entry->d_type == DT_REG) >- result.push_back(realdir + "/" + entry->d_name); >+ string full_name = realdir + "/" + entry->d_name; >+ >+ struct stat my_statbuf; >+ if (stat(full_name.c_str(), &my_statbuf) != 0) >+ { >+ cerr >+ << "*** Failed to stat:" << endl >+ << "*** " << full_name << endl; >+ continue; >+ } >+ >+ if (S_ISDIR(my_statbuf.st_mode)) >+ enumerateFiles(full_name, result, prog); >+ else if (S_ISREG(my_statbuf.st_mode)) >+ result.push_back(full_name); > } > > closedir(dir); >@@ -330,6 +342,7 @@ > catch (...) > { > closedir(dir); >+ throw; > } > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 7672
:
1057
|
1058
| 1061