Deleted Added
full compact
apptype.c (192348) apptype.c (226048)
1/*
2 * Adapted from: apptype.c, Written by Eberhard Mattes and put into the
3 * public domain
4 *
5 * Notes: 1. Qualify the filename so that DosQueryAppType does not do extraneous
6 * searches.
7 *
8 * 2. DosQueryAppType will return FAPPTYP_DOS on a file ending with ".com"

--- 13 unchanged lines hidden (view full) ---

22 * It remains to check the validity of comments (2.) since it's referred to an
23 * "old" OS/2 version.
24 *
25 */
26
27#include "file.h"
28
29#ifndef lint
1/*
2 * Adapted from: apptype.c, Written by Eberhard Mattes and put into the
3 * public domain
4 *
5 * Notes: 1. Qualify the filename so that DosQueryAppType does not do extraneous
6 * searches.
7 *
8 * 2. DosQueryAppType will return FAPPTYP_DOS on a file ending with ".com"

--- 13 unchanged lines hidden (view full) ---

22 * It remains to check the validity of comments (2.) since it's referred to an
23 * "old" OS/2 version.
24 *
25 */
26
27#include "file.h"
28
29#ifndef lint
30FILE_RCSID("@(#)$File: apptype.c,v 1.11 2009/02/04 18:24:32 christos Exp $")
30FILE_RCSID("@(#)$File: apptype.c,v 1.13 2011/09/07 21:57:15 christos Exp $")
31#endif /* lint */
32
33#include <stdlib.h>
34#include <string.h>
35
36#ifdef __EMX__
37#include <io.h>
38#define INCL_DOSSESMGR

--- 28 unchanged lines hidden (view full) ---

67 if (fn == NULL) {
68 if ((fp = fopen(path, "wb")) == NULL) {
69 file_error(ms, errno, "cannot open tmp file `%s'", path);
70 return -1;
71 }
72 if (fwrite(buf, 1, nb, fp) != nb) {
73 file_error(ms, errno, "cannot write tmp file `%s'",
74 path);
31#endif /* lint */
32
33#include <stdlib.h>
34#include <string.h>
35
36#ifdef __EMX__
37#include <io.h>
38#define INCL_DOSSESMGR

--- 28 unchanged lines hidden (view full) ---

67 if (fn == NULL) {
68 if ((fp = fopen(path, "wb")) == NULL) {
69 file_error(ms, errno, "cannot open tmp file `%s'", path);
70 return -1;
71 }
72 if (fwrite(buf, 1, nb, fp) != nb) {
73 file_error(ms, errno, "cannot write tmp file `%s'",
74 path);
75 (void)fclose(fp);
75 return -1;
76 }
77 (void)fclose(fp);
78 }
79 rc = DosQueryAppType((unsigned char *)path, &type);
80
81 if (fn == NULL) {
82 unlink(path);

--- 86 unchanged lines hidden ---
76 return -1;
77 }
78 (void)fclose(fp);
79 }
80 rc = DosQueryAppType((unsigned char *)path, &type);
81
82 if (fn == NULL) {
83 unlink(path);

--- 86 unchanged lines hidden ---