View | Details | Raw Unified | Return to bug 12135
Collapse All | Expand All

(-)scrollkeeper-0.3.14.orig/libs/database.c (-6 / +5 lines)
Lines 27-34 Link Here
27
#include <dirent.h>
27
#include <dirent.h>
28
#include <scrollkeeper.h>
28
#include <scrollkeeper.h>
29
29
30
#define PATHLEN		256
31
32
30
33
/*
31
/*
34
 * Create a directory.  Send errors to appropriate places (STDOUT and log 
32
 * Create a directory.  Send errors to appropriate places (STDOUT and log 
Lines 55-61 static int sk_mkdir(char *path, mode_t o Link Here
55
 */
53
 */
56
int sk_mkdir_with_parents(char *fullpath, mode_t options, char outputprefs)
54
int sk_mkdir_with_parents(char *fullpath, mode_t options, char outputprefs)
57
{
55
{
58
    char path[1024];
56
    char path[PATHLEN];
59
    char slash[]="/";
57
    char slash[]="/";
60
    char delim[]="/";
58
    char delim[]="/";
61
    char *token, *pathcopy;
59
    char *token, *pathcopy;
Lines 63-77 int sk_mkdir_with_parents(char *fullpath Link Here
63
61
64
    pathcopy = strdup(fullpath); /* Copy b/c strtok edits the string it operates on */
62
    pathcopy = strdup(fullpath); /* Copy b/c strtok edits the string it operates on */
65
    path[0] = '\0';              /* Initialize with end of string null character */
63
    path[0] = '\0';              /* Initialize with end of string null character */
66
    if (pathcopy[0] == slash[0]) sprintf(path, "/"); /* preserve any starting slash */
64
    if (pathcopy[0] == slash[0]) strcpy(path, "/"); /* preserve any starting slash */
67
     
65
     
68
    token = strtok (pathcopy, delim);
66
    token = strtok (pathcopy, delim);
69
    delim[0]=slash[0];
67
    delim[0]=slash[0];
70
    while(token != NULL) {
68
    while(token != NULL) {
71
        if (strlen(path) == 0 || ((strlen(path) == 1) && (path[0] == slash[0]))) {
69
        if (strlen(path) == 0 || ((strlen(path) == 1) && (path[0] == slash[0]))) {
72
                sprintf(path, "%s%s", path, token);
70
                strncat(path, token, sizeof(path) - 1);
73
        } else {
71
        } else {
74
                sprintf(path, "%s/%s", path, token);
72
                strncat(path, "/", sizeof(path) - 1);
73
                strncat(path, token, sizeof(path) - 1);
75
        }
74
        }
76
        if (stat(path, &buf) == -1) {
75
        if (stat(path, &buf) == -1) {
77
            if (sk_mkdir(path, options, outputprefs) != 0) {
76
            if (sk_mkdir(path, options, outputprefs) != 0) {
(-)scrollkeeper-0.3.14.orig/libs/install.c (-1 lines)
Lines 32-38 Link Here
32
#define _(String) gettext (String)
32
#define _(String) gettext (String)
33
33
34
#define SEP		"|"
34
#define SEP		"|"
35
#define PATHLEN		256
36
35
37
#ifdef SOLARIS
36
#ifdef SOLARIS
38
/*extern char *strtok_r(char *, const char *, char **);*/
37
/*extern char *strtok_r(char *, const char *, char **);*/
(-)scrollkeeper-0.3.14.orig/libs/scrollkeeper.h.in (-1 / +1 lines)
Lines 32-38 Link Here
32
#define SCROLLKEEPERLOGFILE "@localstatedir@/log/scrollkeeper.log"
32
#define SCROLLKEEPERLOGFILE "@localstatedir@/log/scrollkeeper.log"
33
#define SCROLLKEEPERLOGFILE_ROT "@localstatedir@/log/scrollkeeper.log.1"
33
#define SCROLLKEEPERLOGFILE_ROT "@localstatedir@/log/scrollkeeper.log.1"
34
#define SCROLLKEEPER_OMF_DTD "@prefix@/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd"
34
#define SCROLLKEEPER_OMF_DTD "@prefix@/share/xml/scrollkeeper/dtds/scrollkeeper-omf.dtd"
35
#define PATHLEN		256
35
#define PATHLEN		4096
36
36
37
/*
37
/*
38
 *
38
 *
(-)scrollkeeper-0.3.14.orig/libs/uninstall.c (-2 lines)
Lines 29-36 Link Here
29
29
30
#define _(String) gettext (String)
30
#define _(String) gettext (String)
31
31
32
#define PATHLEN		256
33
34
struct IdTab {
32
struct IdTab {
35
    int id;
33
    int id;
36
    char *locale;
34
    char *locale;

Return to bug 12135