Changeset 30 for branches/1.0/src/splpd.c
- Timestamp:
- May 7, 2010, 6:49:10 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.0/src/splpd.c
r28 r30 489 489 char arg[256]; 490 490 char *j_parms; 491 int allocSize = 0; 491 492 char j_id[3]; 492 493 char parameters[256]; … … 506 507 char spool_dir[256]; 507 508 ULONG ulBootDrive; 509 char *p1 = NULL; 510 char *p2 = NULL; 511 char *p3 = NULL; 512 char *p4 = NULL; 513 char *p5 = NULL; 514 char *p6 = NULL; 515 char *p7 = NULL; 516 char *p8 = NULL; 517 char *p9 = NULL; 508 518 509 519 rc = PrfQueryProfileString (HINI_SYSTEMPROFILE, … … 568 578 // decryptPassword(password_enc,password_dec); 569 579 570 j_parms = malloc((strlen(parameters) - strlen("%file%") + strlen(filename)) * sizeof(char)); 571 572 searchReplace("%file%", filename, parameters, j_parms); 580 // allocate needed space for the returning string +1 (for string terminator) 581 allocSize = strlen(parameters) - strlen("%file%") + strlen(filename); 582 583 j_parms = malloc((allocSize +1) * sizeof(char)); 584 585 // searchReplace(search, replace, string, replaced, allocSize); 586 searchReplace("%file%", filename, parameters, j_parms, allocSize); 587 588 // split into single paramters 589 p1 = strtok (j_parms, " "); 590 p2 = strtok (NULL, " "); 591 p3 = strtok (NULL, " "); 592 p4 = strtok (NULL, " "); 593 p5 = strtok (NULL, " "); 594 p6 = strtok (NULL, " "); 595 p7 = strtok (NULL, " "); 596 p8 = strtok (NULL, " "); 597 p9 = strtok (NULL, " "); 573 598 574 599 if (strlen(workingdir) > 0) … … 576 601 chdir(workingdir); 577 602 }; 578 rc = spawnlp(P_WAIT,binfile,binfile,j_parms,NULL); 603 604 rc = spawnlp(P_WAIT,binfile,binfile,p1,p2,p3,p4,p5,p6,p7,p8,p9,NULL); 579 605 580 606 while (rc != 0) 581 607 { 582 sprintf(errorstr,"Error during spooling to %s %s",binfile,j_parms); 608 sprintf(errorstr,"Error during spooling to %s %s %s %s %s %s %s %s %s %s ",binfile,p1,p2,p3,p4,p5,p6,p7,p8,p9,NULL); 609 583 610 resp = WinMessageBox (HWND_DESKTOP, 584 611 HWND_DESKTOP, … … 588 615 if (resp != MBID_CANCEL ) 589 616 { 590 rc = spawnlp(P_WAIT,binfile,binfile, j_parms,NULL);617 rc = spawnlp(P_WAIT,binfile,binfile,p1,p2,p3,p4,p5,p6,p7,p8,p9,NULL); 591 618 } 592 619 else rc = 0; … … 594 621 595 622 free(j_parms); 623 596 624 strcpy(filename,&szTemp[pos]); 597 625 DosDelete(filename);
Note:
See TracChangeset
for help on using the changeset viewer.