diff和patch说明

先参见wiki的附件和一个网上的说明(转):见附件。

 

说明两点:

1、使用diff –u是通用格式(有---+++的,patch使用此格式),否则是><的形式。

 

2、举个例子,说明patch文件中的内容含义:

--- lib/inets/src/http_client/http_uri.erl.orig   2009-03-12 13:32:39.000000000 +0100

+++ lib/inets/src/http_client/http_uri.erl2009-04-28 23:22:59.215622656 +0200

@@ -61,7 +61,7 @@

          Split = {_, _} ->

             Split;

          URIPart ->

-             case split_uri(URIPart, "\\?", URIPart, 1, 0) of

+            case split_uri(URIPart, "?", URIPart, 1, 0) of

                 Split = {_, _} ->

                    Split;

                 URIPart ->

@@ -76,13 +76,13 @@

 

 

 parse_path_query(PathQuery) ->

-    {Path, Query} =  split_uri(PathQuery, "\\?", {PathQuery, ""}, 1, 0),

+    {Path, Query} =  split_uri(PathQuery, "?", {PathQuery, ""}, 1, 0),

     {path(Path), Query}.

    

 

 parse_host_port(Scheme,"[" ++ HostPort) -> %ipv6

     DefaultPort = default_port(Scheme),

-    {Host, ColonPort} = split_uri(HostPort, "\\]", {HostPort, ""}, 1, 1),

+    {Host, ColonPort} = split_uri(HostPort, "]", {HostPort, ""}, 1, 1),

     {_, Port} = split_uri(ColonPort, ":", {"", DefaultPort}, 0, 1),

     {Host, int_port(Port)};

 

减号表示原文件,加号表示新文件

@@ -61,7 +61,7 @@

-61,7表示原文件第61行开始变,变了7行;+61,7表示新文件第61行开始变,变了7行。

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值