Allow for PATH_MAX not being defined on some systems. Use reasonable default
This commit is contained in:
parent
0e0075b207
commit
51aa31ba4b
@ -1698,6 +1698,14 @@ static const char blurb0[] =
|
||||
"# with the same name in the central directory. The syntax for setting\n"
|
||||
"# values is identical.\n"
|
||||
;
|
||||
// We just use path_max to print the path to /usr/share/recoll/examples
|
||||
// inside the config file. At worse, the text is truncated (using
|
||||
// snprintf). But 4096 should be enough :)
|
||||
#ifndef PATH_MAX
|
||||
#define MYPATHALLOC 4096
|
||||
#else
|
||||
#define MYPATHALLOC PATH_MAX
|
||||
#endif
|
||||
|
||||
// Use uni2ascii -a K to generate these from the utf-8 strings
|
||||
// Swedish and Danish.
|
||||
@ -1712,7 +1720,7 @@ static int ncffiles = sizeof(configfiles) / sizeof(char *);
|
||||
bool RclConfig::initUserConfig()
|
||||
{
|
||||
// Explanatory text
|
||||
const int bs = sizeof(blurb0)+PATH_MAX+1;
|
||||
const int bs = sizeof(blurb0)+MYPATHALLOC+1;
|
||||
char blurb[bs];
|
||||
string exdir = path_cat(m_datadir, "examples");
|
||||
snprintf(blurb, bs, blurb0, exdir.c_str());
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user