Johannes Sixt venit, vidit, dixit 03.03.2009 14:08: > Michael J Gruber schrieb: >> + # normalize path: >> + # multiple //; leading ./; /./; /../; trailing / >> + path=$(printf '%s/\n' "$path" | >> + sed -e ' >> + s|//*|/|g >> + s|^\(\./\)*|| >> + s|/\./|/|g >> + :start >> + s|\([^/]*\)/\.\./||g > > Sorry to say: not yet. This turns "a/b/c/d/../../../d" into "a/b/c/d" > instead of "a/d". Drop the 'g'. Shoot, I thought I had a complete test case... Thanks for spotting. > Once this is fixed, I have to ask what should happen with path names like > "../a/b", "../../a/b"? Should there be a warning or error? That triggers the error message when trying to git add a submodule which is not within the current wc. Same before and after the patch, and I think that's how it should be. > Other than that, this expression works on AIX 4.3.3! Note in particular > that '\n' in the printf format string is essential! I learned that from you ;) Michael > >> + tstart >> + s|/*$|| >> + ') > > -- Hannes > -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html