1
0
Fork 0
mirror of git://git.code.sf.net/p/cdesktopenv/code synced 2025-03-09 15:50:02 +00:00

dtprintinfo: ParseJobs.C: fix some compile errors for solaris

The whole parsing function for solaris printing is really bad and needs
rewritten.
This commit is contained in:
Jon Trulson 2022-01-15 11:58:09 -07:00
parent 341fdfbe71
commit 75c377065a

View file

@ -456,7 +456,6 @@ static void check_dir(char *printer, char *tmp_dir, StatusLineList *job_list,
DIR *lp_tmp_dir; DIR *lp_tmp_dir;
struct dirent *dir_struct; struct dirent *dir_struct;
char buf[256]; char buf[256];
int req_len;
int spool_len; int spool_len;
int line_ct; int line_ct;
char *line; char *line;
@ -472,16 +471,15 @@ static void check_dir(char *printer, char *tmp_dir, StatusLineList *job_list,
char *jobname; char *jobname;
StatusLineList j_list; StatusLineList j_list;
char *filename = new char[200]; char *filename = new char[PATH_MAX];
char *filename1 = new char[200]; char *filename1 = new char[PATH_MAX];
char *request = new char[300]; char *request = new char[PATH_MAX];
char *spool_dir = new char[300]; char *spool_dir = new char[PATH_MAX];
if (getenv("REQ_DIR")) if (getenv("REQ_DIR"))
snprintf(request, sizeof(request), "%s/%s", getenv("REQ_DIR"), tmp_dir); snprintf(request, sizeof(request), "%s/%s", getenv("REQ_DIR"), tmp_dir);
else else
sprintf(request, sizeof(request), "%s", REQ_DIR, tmp_dir); snprintf(request, sizeof(request), REQ_DIR, tmp_dir);
req_len = strlen(request);
snprintf(spool_dir, sizeof(spool_dir), "%s/%s", SPOOL_DIR, tmp_dir); snprintf(spool_dir, sizeof(spool_dir), "%s/%s", SPOOL_DIR, tmp_dir);
spool_len = strlen(spool_dir); spool_len = strlen(spool_dir);
@ -503,9 +501,7 @@ static void check_dir(char *printer, char *tmp_dir, StatusLineList *job_list,
if (strcmp(dir_struct->d_name + len - 2, "-0")) if (strcmp(dir_struct->d_name + len - 2, "-0"))
continue; continue;
// *(request + req_len) = '\0'; std::string file_req(request);
// strcat(request + req_len, dir_struct->d_name);
std:string file_req(request);
file_req.append(dir_struct->d_name); file_req.append(dir_struct->d_name);
if (!(req = fopen(file_req.c_str(), "r"))) if (!(req = fopen(file_req.c_str(), "r")))