Changeset 681


Ignore:
Timestamp:
Sep 10, 2003, 4:39:08 PM (22 years ago)
Author:
bird
Message:

#456: Include files fixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/emx/src/emxomf/emxomf.c

    • Property cvs2svn:cvs-rev changed from 1.23 to 1.24
    r680 r681  
    27252725}
    27262726
     2727/* Converts dashed filenames to somewhat absolute ones assuming that
     2728   the current directory is what they're relative to. */
     2729
     2730static int abspath_filename(char *dst, const char *src, int size)
     2731{
     2732  int   rc = -1;
     2733  char *psz;
     2734 
     2735  if (src[1] != ':' && src[0] != '\\' && src[0] != '/')
     2736    rc = _abspath(dst, src, size);
     2737  if (rc)
     2738  {
     2739      *dst = '\0';
     2740      strncat(dst, src, size);
     2741  }
     2742
     2743  for (psz = dst; *psz; psz++)
     2744    if (*psz == '/')
     2745      *psz = '\\';
     2746  return psz - dst;
     2747}
    27272748
    27282749/* Derive the module name and store it to the mod_name variable.
     
    28212842    if (strcmp (file_list[i], name) == 0)
    28222843      return i;
    2823   if (file_grow.count >= 255)
     2844  if (hll_version <= 3 && file_grow.count >= 255)
    28242845    {
    28252846      warning ("Too many source files, cannot convert line number info");
     
    29592980      return;
    29602981
    2961 
     2982  /* Make the paths absolute - TODO: this might be done by GCC as well.. */
     2983
     2984  for (i = 0; i < file_grow.count; ++i)
     2985    {
     2986      char buf[260];
     2987      len = abspath_filename (buf, file_list[i], 255);
     2988      file_list[i] = xrealloc(file_list[i], len + 1);
     2989      memcpy(file_list[i], buf, len + 1);
     2990    }
     2991 
    29622992  /* Compute the size of the file names table. */
    29632993
     
    29823012      put_8 (3);                    /* Entry type: some visual age stuff I believe */
    29833013      put_8 (0);                    /* Reserved */
    2984       put_16 (1);                   /* Count of line number entries */
     3014      put_16 (file_grow.count);     /* Count of line number entries */
    29853015      put_16 (0);                   /* Segment number */
    29863016      put_32 (len);                 /* Size of file names table */
     
    29923022      for (i = 0; i < file_grow.count; ++i)
    29933023        {
    2994           len = strlen (file_list[i]);
    2995           if (len > sizeof (buf) - 1)
    2996             len = sizeof (buf) - 1;
    2997           memcpy (buf, file_list[i], len);
    2998           buf[len] = 0;
    2999           convert_filename (buf);
     3024          len = strlen(file_list[i]);
    30003025          if (started && !fits (1 + len))
    30013026            {
     
    30113036            }
    30123037          put_8 (len);
    3013           put_mem (buf, len);
     3038          put_mem (file_list[i], len);
    30143039        }
    30153040
     
    30533078              }
    30543079            put_16 (line_list[i].line);
    3055             put_16(line_list[i].file_index + 1);
     3080            put_16 (line_list[i].file_index + 1);
    30563081            put_32 (line_list[i].addr);
    30573082          }
Note: See TracChangeset for help on using the changeset viewer.