View | Details | Raw Unified | Return to issue 74007
Collapse All | Expand All

(-)dmake/dag.c (-2 / +6 lines)
Lines 709-714 Link Here
709
{
709
{
710
   static char *cpath = NIL(char);
710
   static char *cpath = NIL(char);
711
711
712
   DB_ENTER( "_normalize_path" );
713
712
   if ( !cpath && ( (cpath = MALLOC( PATH_MAX, char)) == NIL(char) ) )
714
   if ( !cpath && ( (cpath = MALLOC( PATH_MAX, char)) == NIL(char) ) )
713
      No_ram();
715
      No_ram();
714
716
Lines 718-724 Link Here
718
    * indistinguishable from a literal $ characters at this point we skip
720
    * indistinguishable from a literal $ characters at this point we skip
719
    * the normalization if a $ is found.  */
721
    * the normalization if a $ is found.  */
720
   if( strchr(path, '$') ) {
722
   if( strchr(path, '$') ) {
721
      return path;
723
      DB_RETURN( path );
722
   }
724
   }
723
725
724
#if __CYGWIN__
726
#if __CYGWIN__
Lines 728-733 Link Here
728
      if (err)
730
      if (err)
729
	 Fatal( "error converting \"%s\" - %s\n",
731
	 Fatal( "error converting \"%s\" - %s\n",
730
		path, strerror (errno));
732
		path, strerror (errno));
733
      if( path[2] != '/' && path[2] != '\\' )
734
	 Warning("Malformed DOS path %s converted to %s", path, cpath);
731
   }
735
   }
732
   else
736
   else
733
#endif
737
#endif
Lines 738-742 Link Here
738
742
739
   DB_PRINT( "path", ("normalized: %s", cpath ));
743
   DB_PRINT( "path", ("normalized: %s", cpath ));
740
744
741
   return cpath;
745
   DB_RETURN( cpath );
742
}
746
}
(-)dmake/imacs.c (+1 lines)
Lines 101-106 Link Here
101
   _set_string_var("SHELLMETAS",   "",  M_DEFAULT, &Shell_metas );
101
   _set_string_var("SHELLMETAS",   "",  M_DEFAULT, &Shell_metas );
102
   _set_string_var("GROUPSUFFIX",  "",  M_DEFAULT, &Grp_suff    );
102
   _set_string_var("GROUPSUFFIX",  "",  M_DEFAULT, &Grp_suff    );
103
   _set_string_var("AUGMAKE",NIL(char), M_DEFAULT, &Augmake     );
103
   _set_string_var("AUGMAKE",NIL(char), M_DEFAULT, &Augmake     );
104
   _set_string_var("OOOSPECIAL",   "",  M_DEFAULT, &OOoSpecial );
104
   _set_string_var(".KEEP_STATE",  "",  M_DEFAULT, &Keep_state  );
105
   _set_string_var(".KEEP_STATE",  "",  M_DEFAULT, &Keep_state  );
105
   _set_string_var(".NOTABS",      "",  M_MULTI, &Notabs );
106
   _set_string_var(".NOTABS",      "",  M_MULTI, &Notabs );
106
   _set_string_var(".DIRCACHE",    "y", M_DEFAULT, &UseDirCache );
107
   _set_string_var(".DIRCACHE",    "y", M_DEFAULT, &UseDirCache );
(-)dmake/path.c (-6 / +31 lines)
Lines 166-177 Link Here
166
   register char *p;
166
   register char *p;
167
   register char *q;
167
   register char *q;
168
   char *tpath;
168
   char *tpath;
169
   int hasdriveletter = 0;
170
171
   DB_ENTER( "Clean_path" );
169
172
170
   /* Skip the root part. */
173
   /* Skip the root part. */
171
   tpath=path;
174
   tpath=path;
175
172
#ifdef HAVE_DRIVE_LETTERS
176
#ifdef HAVE_DRIVE_LETTERS
173
   if( *tpath && tpath[1] == ':' && isalpha(*tpath) )
174
	 tpath+=2;
175
177
176
   /* Change all occurences from DirBrkStr to *DirSepStr. */
178
   /* Change all occurences from DirBrkStr to *DirSepStr. */
177
#if __CYGWIN__
179
#if __CYGWIN__
Lines 181-187 Link Here
181
   for( q = tpath; (q = strchr(q, '/')) != NIL(char); )
183
   for( q = tpath; (q = strchr(q, '/')) != NIL(char); )
182
      *q = *DirSepStr;
184
      *q = *DirSepStr;
183
#endif
185
#endif
186
   /* The following dosn't trigger often because _normalize_path() uses
187
    * a cygwin function and bypasses Clean_path() if it encounters a path
188
    * with a drive letter. */
189
   if( *tpath && tpath[1] == ':' && isalpha(*tpath) ) {
190
      hasdriveletter = 1;
191
      tpath+=2;
192
      if( *tpath != *DirSepStr )
193
	 Warning("Malformed DOS path %s", path);
194
   }
195
184
#endif
196
#endif
197
198
   /* Collapse > 2 ( > 1 if its an absolute DOS path ) into one slash.
199
    * Keep // as it is reserved in posix. */
200
   q = tpath;
201
   for( ; *q == *DirSepStr ; ++q )
202
      ;
203
   if( q - tpath > 2 - hasdriveletter ) {
204
      strcpy(tpath+1, q);
205
   }
206
207
   /* Set tpath after leading slash / drive letter. */
185
   for( ; *tpath == *DirSepStr ; ++tpath )
208
   for( ; *tpath == *DirSepStr ; ++tpath )
186
      ;
209
      ;
187
   q = tpath;
210
   q = tpath;
Lines 204-211 Link Here
204
	 continue;
227
	 continue;
205
      }
228
      }
206
229
207
      /* Remove './' */
230
      /* Remove './'. If OOOSPECIAL is set do this only if it is not at
208
      if ( p-q == 1 && *q == '.' ) {
231
       * the start of the path. */
232
      if ( p-q == 1 && *q == '.' && (q != path || !STOBOOL(OOoSpecial)) ) {
209
	 strcpy(q,p+1);
233
	 strcpy(q,p+1);
210
	 q = tpath;
234
	 q = tpath;
211
	 continue;
235
	 continue;
Lines 230-235 Link Here
230
	 q = p+1;
254
	 q = p+1;
231
   }
255
   }
232
256
233
   DB_PRINT( "path", ("path: %s", path ));
257
   DB_PRINT( "path", ("Cleaned path: %s", path ));
234
   return;
258
259
   DB_VOID_RETURN;
235
}
260
}
(-)dmake/vextern.h (+1 lines)
Lines 60-65 Link Here
60
EXTERN  char*   LastMacName;	/* Last macro successfully parsed	  */
60
EXTERN  char*   LastMacName;	/* Last macro successfully parsed	  */
61
EXTERN  char*   UseDirCache;    /* The value of .DIRCACHE                 */
61
EXTERN  char*   UseDirCache;    /* The value of .DIRCACHE                 */
62
EXTERN  char*   DcacheRespCase; /* TRUE if we are to respect dcache case  */
62
EXTERN  char*   DcacheRespCase; /* TRUE if we are to respect dcache case  */
63
EXTERN  char*   OOoSpecial;     /* Enable special behavior for OOo build. */
63
EXTERN	int	Target;		/* TRUE if a default target was found in  *
64
EXTERN	int	Target;		/* TRUE if a default target was found in  *
64
				 * a makefile or on the commandline       */
65
				 * a makefile or on the commandline       */
65
EXTERN	int	If_expand;	/* TRUE if calling Expand from getinp.c   */
66
EXTERN	int	If_expand;	/* TRUE if calling Expand from getinp.c   */

Return to issue 74007