Ignore:
Timestamp:
Jan 13, 2010, 7:52:51 PM (16 years ago)
Author:
Herwig Bauernfeind
Message:

_divers os2_getExePath applied to BINDIR, SBINDIR and SWATDIR in 3.0.x

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/samba-3.0/source/lib/os2path.c

    r366 r367  
    1111#include <string.h>
    1212
    13 // samba DEBUG() needs the following includes and defines
     13// Samba DEBUG() needs the following includes and defines
    1414#define PRINTF_ATTRIBUTE(a1, a2) __attribute__ ((format (__printf__, a1, a2)))
    1515#include "pstring.h"
     
    2121int os2_GetExePath(char *buff)
    2222{
    23         APIRET rc = NO_ERROR;
    24         PPIB ppib = NULL;
    25         char sExePath [_MAX_PATH];
    26         char sDrive [_MAX_PATH], sDir [_MAX_DIR];
     23        APIRET rc = NO_ERROR;
     24        PPIB ppib = NULL;
     25        char sExePath [_MAX_PATH];
     26        char sDrive [_MAX_PATH], sDir [_MAX_DIR];
    2727
    2828        // we search for the infoblock to get the module name
    29         rc = DosGetInfoBlocks(NULL, &ppib);
     29        rc = DosGetInfoBlocks(NULL, &ppib);
    3030        if (rc != NO_ERROR)
    3131        {
     
    3333        }
    3434
    35         // wit the module name we get the path (including the exe name)
    36         rc = DosQueryModuleName(ppib->pib_hmte, sizeof(sExePath), sExePath);
    37         if (rc != NO_ERROR)
    38         {
    39                 return -1;
    40         }
     35        // with the module name we get the path (including the exe name)
     36        rc = DosQueryModuleName(ppib->pib_hmte, sizeof(sExePath), sExePath);
     37        if (rc != NO_ERROR)
     38        {
     39                return -1;
     40        }
    4141
    42         // we spitt to the different values
    43         _splitpath(sExePath, sDrive, sDir, NULL, NULL);
    44         // strcat(sDrive, sDir);
    45         strncat(sDrive, sDir, strlen(sDir) -1);
    46         strcpy(buff, sDrive);
     42        // we split to the different values
     43        _splitpath(sExePath, sDrive, sDir, NULL, NULL);
     44        // strcat(sDrive, sDir);
     45        strncat(sDrive, sDir, strlen(sDir) -1);
     46        strcpy(buff, sDrive);
    4747
    4848        return 0;
Note: See TracChangeset for help on using the changeset viewer.