Ignore:
Timestamp:
Aug 19, 2002, 11:23:17 PM (23 years ago)
Author:
umoeller
Message:

Dialog formatter rewrite.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/apps.c

    r208 r209  
    879879    // if the path has spaces, or other invalid characters,
    880880    // include it in quotes V0.9.21 (2002-08-12) [umoeller]
    881     if (fQuotes = !!strpbrk(pProgDetails->pszExecutable, " +&|"))
     881    if (fQuotes = !!strpbrk(pProgDetails->pszExecutable, " +&|="))
    882882        xstrcatc(pstrParams, '"');
     883            // @@bugbug "=" still doesn't work
    883884
    884885    #ifdef DEBUG_PROGRAMSTART
     
    11651166 *@@changed V0.9.20 (2002-07-03) [umoeller]: fixed Win-OS/2 full screen breakage
    11661167 *@@changed V0.9.20 (2002-07-03) [umoeller]: fixed broken bat and cmd files when PROG_DEFAULT was set
     1168 *@@changed V0.9.21 (2002-08-18) [umoeller]: fixed cmd and bat files that had "=" in their paths
    11671169 */
    11681170
     
    13471349                        arc = ERROR_PATH_NOT_FOUND;
    13481350                }
     1351
     1352// V0.9.21: this define is never set. I have thus completely
     1353// disabled the batch hacks that we used to provide, that is
     1354// we no longer change the "c:\path\batch.cmd" to "cmd.exe /c c:\path\batch.cmd"
     1355// because it is perfectly valid to call WinStartApp with a
     1356// batch file. The problem with my code was that cmd.exe has
     1357// a weird bug in that if you give it something via /c that
     1358// has an equals character (=) in its path, e.g. "c:\path=path\batch.cmd",
     1359// the command parser apparently stops at the first "=" and
     1360// reports "c:\path" not found or something. What a bitch.
     1361#ifdef ENABLEBATCHHACKS
    13491362
    13501363                // we frequently get here for BAT and CMD files
     
    13991412                    break;
    14001413                } // end switch (Details.progt.progc)
     1414#endif // ENABLEBATCHHACKS
    14011415            }
    14021416        }
     
    20452059 *@@changed V0.9.20 (2002-08-10) [umoeller]: fixed missing destroy window, made wait optional
    20462060 *@@changed V0.9.20 (2002-08-10) [umoeller]: added pcszWorkingDir
    2047  */
    2048 
    2049 HAPP appQuickStartApp(const char *pcszFile,
    2050                       ULONG ulProgType,             // e.g. PROG_PM
    2051                       const char *pcszArgs,         // in: arguments (can be NULL)
    2052                       const char *pcszWorkingDir,   // in: working dir (can be NULL)
    2053                       PULONG pulExitCode)           // out: exit code; if ptr is NULL, we don't wait
     2061 *@@changed V0.9.21 (2002-08-18) [umoeller]: changed prototype to return APIRET
     2062 */
     2063
     2064APIRET appQuickStartApp(const char *pcszFile,
     2065                        ULONG ulProgType,             // e.g. PROG_PM
     2066                        const char *pcszArgs,         // in: arguments (can be NULL)
     2067                        const char *pcszWorkingDir,   // in: working dir (can be NULL)
     2068                        HAPP *phapp,
     2069                        PULONG pulExitCode)           // out: exit code; if ptr is NULL, we don't wait
    20542070{
     2071    APIRET         arc = NO_ERROR;
    20552072    PROGDETAILS    pd = {0};
    2056     HAPP           happ,
    2057                    happReturn = NULLHANDLE;
     2073    HAPP           happReturn = NULLHANDLE;
    20582074    CHAR           szDir[CCHMAXPATH] = "";
    20592075    PCSZ           p;
     
    20772093
    20782094    if (    (hwndObject = winhCreateObjectWindow(WC_STATIC, NULL))
    2079          && (!appStartApp(hwndObject,
    2080                           &pd,
    2081                           0,
    2082                           &happ,
    2083                           0,
    2084                           NULL))
     2095         && (!(arc = appStartApp(hwndObject,
     2096                                 &pd,
     2097                                 0,
     2098                                 phapp,
     2099                                 0,
     2100                                 NULL)))
    20852101       )
    20862102    {
    20872103        if (pulExitCode)
    20882104            appWaitForApp(hwndObject,
    2089                           happ,
     2105                          *phapp,
    20902106                          pulExitCode);
    20912107
    2092         happReturn = happ;
    2093 
    20942108        WinDestroyWindow(hwndObject);       // was missing V0.9.20 (2002-08-10) [umoeller]
    20952109    }
    20962110
    2097     return happReturn;
     2111    return arc;
    20982112}
    20992113
     
    21032117 *      URL.
    21042118 *
     2119 *      We return TRUE if appQuickStartApp succeeded with
     2120 *      that URL.
     2121 *
    21052122 *@@added V0.9.20 (2002-08-10) [umoeller]
    21062123 */
    21072124
    2108 BOOL appOpenURL(PCSZ pcszURL)
     2125APIRET appOpenURL(PCSZ pcszURL,           // in: URL to open
     2126                  PSZ pszAppStarted,      // out: application that was started
     2127                  ULONG cbAppStarted)     // in: size of that buffer
    21092128{
    2110     BOOL        brc = FALSE;
     2129    APIRET      arc = NO_ERROR;
    21112130
    21122131    CHAR        szBrowser[CCHMAXPATH],
     
    21232142                              sizeof(szBrowser)))
    21242143    {
    2125         PSZ pszDefParams;
     2144        PSZ     pszDefParams;
     2145        HAPP    happ;
    21262146
    21272147        if (pszDefParams = prfhQueryProfileData(HINI_USER,
     
    21452165
    21462166
    2147         brc = !!appQuickStartApp(szBrowser,
    2148                                  PROG_DEFAULT,
    2149                                  strParameters.psz,
    2150                                  szStartupDir,
    2151                                  NULL);            // don't wait
     2167        arc = appQuickStartApp(szBrowser,
     2168                               PROG_DEFAULT,
     2169                               strParameters.psz,
     2170                               szStartupDir,
     2171                               &happ,
     2172                               NULL);     // don't wait
     2173
     2174        if (pszAppStarted)
     2175            strhncpy0(pszAppStarted,
     2176                      szBrowser,
     2177                      cbAppStarted);
    21522178    }
    21532179
    21542180    xstrClear(&strParameters);
    21552181
    2156     return brc;
     2182    return arc;
    21572183}
Note: See TracChangeset for help on using the changeset viewer.