BUG: Extra Line Feeds Added when Moving File Between Folders

Last reviewed: December 9, 1997
Article ID: Q166677
The information in this article applies to:
  • Microsoft Visual InterDev, version 1.0

SYMPTOMS

Sometimes when a file containing at least one relative URL is moved into a folder that changes the reference to the linked file, an extra line feed is added to all scripts (whether contained within <SCRIPT>...</SCRIPT> tags or within <%...%> delimiters) and comment blocks (enclosed with <!--...-->).

CAUSE

When Link Repair is turned on, FrontPage Extensions look for relative URLs in the file. If found, they modify the URL as necessary to ensure that the linked files remain valid when called from the new directory. FrontPage Extensions may also attempt to insert missing HTML in the file. When this routine runs, it adds an extra line feed when it encounters server-side scripts.

RESOLUTION

Turn off Link Repair or use absolute references to linked files.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Be sure Link Repair is enabled for the project (refer to the Properties page for the Project).

  2. Be sure your Project has at least one subdirectory, for example, /images.

  3. Create an .asp file with the following contents (you don't need a real .jpg file, just a relative reference):

          <%
          Response.Write "test"
          Response.Write "test2"
          %>
          <img src="images/test.jpg">
    

  4. Copy this example to your Clipboard for reuse below.

  5. Release Working Copy for this .asp file and save to the root directory when prompted.

  6. Move the file into the images directory.

  7. Open the file. You are prompted with a message box that says, "Lines ending with only a carriage return have been detected. These will be modified to include a line feed."

  8. The file looks something like this:

          <%
    

          Response.Write "test"
    

          Response.Write "test2"
    

          %><html>
    

          <body>
    

          <p><img src="../images/test.jpg"> </p>
          </body>
          </html>
    

    Visual InterDev has added syntax to make a legal HTML file. In the process it has added extra lines in the source ASP code and around the first two HTML tags.

  9. Release the Working Copy of this file, then move it back to the root directory. Open the file and replace its contents with the contents on your Clipboard. You should now be in your original state.

  10. Remove the IMG tag so there is no URL in your file or make the relative address absolute by placing a "/" before "images." Release the Working Copy and save as before.

  11. Move the file to the images directory again, and open it. This time nothing has changed because there is no relative URL in the file.

REFERENCES

For the latest Knowledge Base articles and other support information on Visual InterDev and Active Server Pages, see the following page on the Microsoft Technical Support site:

   http://support.microsoft.com/support/vinterdev/

Keywords          : VIScripting kbprg kbbuglist
Version           : 1.0
Platform          : WINDOWS
Issue type        : kbbug


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: December 9, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.